Fix bug with evaluating an expression in it's own binding

This commit is contained in:
Amjad Masad
2015-12-06 07:56:17 -08:00
parent abb85b498a
commit 036e90e9cc
2 changed files with 21 additions and 1 deletions

View 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();
}
}
}
}
});