validate against multiple parents on AST_Node (#4032)

- fix related issues in `global_defs`, `ie8` & `reduce_vars`
This commit is contained in:
Alex Lam S.L
2020-07-31 01:09:19 +01:00
committed by GitHub
parent ee632a5519
commit 88423f2574
7 changed files with 63 additions and 11 deletions

View File

@@ -12,6 +12,20 @@ must_replace: {
}
}
repeated_nodes: {
options = {
global_defs: {
"@N": "rand()",
},
}
input: {
console.log(N, N);
}
expect: {
console.log(rand(), rand());
}
}
keyword: {
options = {
global_defs: {

View File

@@ -2691,3 +2691,26 @@ issue_4028: {
}
expect_stdout: "string"
}
issue_2737: {
options = {
ie8: true,
reduce_vars: true,
unused: true,
}
input: {
(function(a) {
a();
})(function f() {
console.log(typeof f);
});
}
expect: {
(function(a) {
a();
})(function f() {
console.log(typeof f);
});
}
expect_stdout: "function"
}