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:
Shu-yu Guo 2016-03-17 18:53:03 -07:00
parent be8e355f36
commit 3490838493
2 changed files with 7 additions and 1 deletions

View File

@ -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);

View File

@ -0,0 +1,5 @@
(function * YearFromTime(x, ... get) {
try {} catch (x) {
for (var x;;);
}
})();