Bug 776191 - Add missing case of 'with' deoptimization, r=dvander

This commit is contained in:
Gary Kwong 2012-07-23 13:39:18 -07:00
parent de30491499
commit 9c56bfaed4
2 changed files with 8 additions and 4 deletions

View File

@ -1132,11 +1132,8 @@ 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() ||
(outer_dn && tc->innermostWith &&
outer_dn->pn_pos < tc->innermostWith->pn_pos)) {
if (funtc->sc->funHasExtensibleScope() || tc->innermostWith)
DeoptimizeUsesWithin(dn, fn->pn_pos);
}
if (!outer_dn) {
AtomDefnAddPtr p = tc->lexdeps->lookupForAdd(atom);

View File

@ -0,0 +1,7 @@
(function() {
let(a, b, c) {
((function() {
with({}) let(b) { ((function() { c = 0 })()) }
})())
}
})()