Bug 672892 - CloneLeftHandSide should not also clone the right-hand side. Well sure it sounds obvious when you write it out like that. r=dvander.

--HG--
extra : rebase_source : cfcaf1f4c681fc67fd70d20818bdccf5183cde94
This commit is contained in:
Jason Orendorff 2011-08-12 13:43:21 -05:00
parent 4ca39c776b
commit 6c668d27a8
3 changed files with 17 additions and 6 deletions

View File

@ -4967,14 +4967,16 @@ CloneLeftHandSide(JSParseNode *opn, JSTreeContext *tc)
pn->pn_link = dn->dn_uses;
dn->dn_uses = pn;
} else if (opn->pn_defn) {
/* We copied some definition-specific state into pn. Clear it out. */
} else {
pn->pn_expr = NULL;
pn->pn_cookie.makeFree();
pn->pn_dflags &= ~PND_BOUND;
pn->pn_defn = false;
if (opn->pn_defn) {
/* We copied some definition-specific state into pn. Clear it out. */
pn->pn_cookie.makeFree();
pn->pn_dflags &= ~PND_BOUND;
pn->pn_defn = false;
LinkUseToDef(pn, (JSDefinition *) opn, tc);
LinkUseToDef(pn, (JSDefinition *) opn, tc);
}
}
return pn;
}

View File

@ -109,6 +109,7 @@ script regress-646820-3.js
script regress-665355.js
script regress-666599.js
script regress-667047.js
script regress-672892.js
script regress-673070-1.js
script regress-673070-2.js
script regress-673070-3.js

View File

@ -0,0 +1,8 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
with (0)
for (var b = 0 in 0) // don't assert in parser
;
reportCompare(0, 0, 'ok');