Although it would be nice to enforce `AST_Node` cloning during transformation, that ship has sailed a long time ago. We now get the assigned value when resolving `AST_SymbolRef` instead of `reset_opt_flags()`, which has the added advantage of improved compressor efficiency. fixes #1787
56 lines
1.1 KiB
JavaScript
56 lines
1.1 KiB
JavaScript
chained_evaluation_1: {
|
|
options = {
|
|
collapse_vars: true,
|
|
evaluate: true,
|
|
reduce_vars: true,
|
|
unused: true,
|
|
}
|
|
input: {
|
|
(function() {
|
|
var a = 1;
|
|
(function() {
|
|
var b = a, c;
|
|
c = f(b);
|
|
c.bar = b;
|
|
})();
|
|
})();
|
|
}
|
|
expect: {
|
|
(function() {
|
|
(function() {
|
|
var c;
|
|
c = f(1);
|
|
c.bar = 1;
|
|
})();
|
|
})();
|
|
}
|
|
}
|
|
|
|
chained_evaluation_2: {
|
|
options = {
|
|
collapse_vars: true,
|
|
evaluate: true,
|
|
reduce_vars: true,
|
|
unused: true,
|
|
}
|
|
input: {
|
|
(function() {
|
|
var a = "long piece of string";
|
|
(function() {
|
|
var b = a, c;
|
|
c = f(b);
|
|
c.bar = b;
|
|
})();
|
|
})();
|
|
}
|
|
expect: {
|
|
(function() {
|
|
(function() {
|
|
var c, b = "long piece of string";
|
|
c = f(b);
|
|
c.bar = b;
|
|
})();
|
|
})();
|
|
}
|
|
}
|