Fix bug with evaluating an expression in it's own binding
This commit is contained in:
18
packages/babel-core/test/fixtures/plugins/multiple-definition-evaluation/exec.js
vendored
Normal file
18
packages/babel-core/test/fixtures/plugins/multiple-definition-evaluation/exec.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
var code = multiline([
|
||||
"function foo() {",
|
||||
" var a = a ? a : a;",
|
||||
"}",
|
||||
]);
|
||||
|
||||
transform(code, {
|
||||
plugins: function (b) {
|
||||
var t = b.types;
|
||||
return {
|
||||
visitor: {
|
||||
ConditionalExpression: function(path) {
|
||||
path.get("test").evaluateTruthy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user