mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1250192 - Do not synthesize a var binding for Annex B.3.5 if there is an arg binding of the same name. (r=jorendorff)
This commit is contained in:
parent
be8e355f36
commit
3490838493
@ -4122,7 +4122,8 @@ Parser<ParseHandler>::bindVar(BindData<ParseHandler>* data,
|
||||
|
||||
// Synthesize a new 'var' binding if one does not exist.
|
||||
DefinitionNode last = pc->decls().lookupLast(name);
|
||||
if (last && parser->handler.getDefinitionKind(last) != Definition::VAR) {
|
||||
Definition::Kind lastKind = parser->handler.getDefinitionKind(last);
|
||||
if (last && lastKind != Definition::VAR && lastKind != Definition::ARG) {
|
||||
parser->handler.setFlag(parser->handler.getDefinitionNode(last), PND_CLOSED);
|
||||
|
||||
Node synthesizedVarName = parser->newName(name);
|
||||
|
5
js/src/jit-test/tests/parser/bug-1250192.js
Normal file
5
js/src/jit-test/tests/parser/bug-1250192.js
Normal file
@ -0,0 +1,5 @@
|
||||
(function * YearFromTime(x, ... get) {
|
||||
try {} catch (x) {
|
||||
for (var x;;);
|
||||
}
|
||||
})();
|
Loading…
Reference in New Issue
Block a user