fix return from recursive IIFE (#1570)

`side-effects` did not account for IIFEs being able to reference itself thus making its return value potentially significant
This commit is contained in:
Alex Lam S.L
2017-03-08 03:31:51 +08:00
committed by GitHub
parent 144052ca49
commit bd6dee52ab
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
inner_reference: {
options = {
side_effects: true,
}
input: {
!function f(a) {
return a && f(a - 1) + a;
}(42);
!function g(a) {
return a;
}(42);
}
expect: {
!function f(a) {
return a && f(a - 1) + a;
}(42);
!void 0;
}
}