evaluate AST_SymbolRef as parameter

fix invalid boolean conversion now exposed in `make_node_from_constant()`

closes #1477
This commit is contained in:
alexlamsl
2017-02-18 19:22:24 +08:00
parent a0f4fd390a
commit 974247c8c0
2 changed files with 56 additions and 6 deletions

View File

@@ -598,3 +598,50 @@ unsafe_prototype_function: {
var h = "" + ({toString: 0});
}
}
call_args: {
options = {
evaluate: true,
}
input: {
const a = 1;
console.log(a);
+function(a) {
return a;
}(a);
}
expect: {
const a = 1;
console.log(1);
+function(a) {
return a;
}(1);
}
}
in_boolean_context: {
options = {
booleans: true,
evaluate: true,
}
input: {
!42;
!"foo";
![1, 2];
!/foo/;
!b(42);
!b("foo");
!b([1, 2]);
!b(/foo/);
}
expect: {
!1;
!1;
!1;
!1;
!b(42);
!b("foo");
!b([1, 2]);
!b(/foo/);
}
}