From 3d4182f4e142258edfc6b74ca233e1ab2a9656f3 Mon Sep 17 00:00:00 2001 From: Gary Kwong Date: Mon, 23 Jul 2012 14:00:36 -0700 Subject: [PATCH] Backed out changeset 4ee96b33d289, r=wrongAuthor --- js/src/frontend/Parser.cpp | 5 ++++- js/src/jit-test/tests/basic/testBug776191.js | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 js/src/jit-test/tests/basic/testBug776191.js diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 2bab50443220..f963f50f0a40 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -1132,8 +1132,11 @@ LeaveFunction(ParseNode *fn, Parser *parser, PropertyName *funName = NULL, * by eval and function statements (which both flag the function as * having an extensible scope) or any enclosing 'with'. */ - if (funtc->sc->funHasExtensibleScope() || tc->innermostWith) + if (funtc->sc->funHasExtensibleScope() || + (outer_dn && tc->innermostWith && + outer_dn->pn_pos < tc->innermostWith->pn_pos)) { DeoptimizeUsesWithin(dn, fn->pn_pos); + } if (!outer_dn) { AtomDefnAddPtr p = tc->lexdeps->lookupForAdd(atom); diff --git a/js/src/jit-test/tests/basic/testBug776191.js b/js/src/jit-test/tests/basic/testBug776191.js deleted file mode 100644 index c821cf84c8b7..000000000000 --- a/js/src/jit-test/tests/basic/testBug776191.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() { - let(a, b, c) { - ((function() { - with({}) let(b) { ((function() { c = 0 })()) } - })()) - } -})()