mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 685321: detect closed-over variables conservatively, r=jorendorff
This commit is contained in:
parent
c82af6d14e
commit
ef360d317a
@ -673,6 +673,8 @@ Define(ParseNode *pn, JSAtom *atom, TreeContext *tc, bool let = false)
|
||||
if ((!pnu || pnu->pn_blockid < tc->bodyid) && foundLexdep)
|
||||
tc->lexdeps->remove(atom);
|
||||
}
|
||||
|
||||
pn->pn_dflags |= dn->pn_dflags & PND_CLOSED;
|
||||
}
|
||||
|
||||
Definition *toAdd = (Definition *) pn;
|
||||
|
11
js/src/jit-test/tests/basic/bug685321.js
Normal file
11
js/src/jit-test/tests/basic/bug685321.js
Normal file
@ -0,0 +1,11 @@
|
||||
function f() {
|
||||
function g() {
|
||||
for (var i = 0; i < 3; i++)
|
||||
x = i;
|
||||
};
|
||||
var [x] = 0;
|
||||
g();
|
||||
assertEq(x, 2);
|
||||
print(x);
|
||||
}
|
||||
f();
|
Loading…
Reference in New Issue
Block a user