Bug 1382209 - Part 2: Use correct YieldHandling for module contexts. r=shu

This commit is contained in:
André Bargull 2017-08-09 11:37:23 +02:00
Родитель c838e0d0aa
Коммит 0865d1a536
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -1038,8 +1038,8 @@ Parser<ParseHandler, CharT>::parse()
}
/*
* Strict mode forbids introducing new definitions for 'eval', 'arguments', or
* for any strict mode reserved word.
* Strict mode forbids introducing new definitions for 'eval', 'arguments',
* 'let', 'static', 'yield', or for any strict mode reserved word.
*/
bool
ParserBase::isValidStrictBinding(PropertyName* name)
@ -2285,7 +2285,7 @@ Parser<FullParseHandler, char16_t>::moduleBody(ModuleSharedContext* modulesc)
return null();
AutoAwaitIsKeyword<Parser> awaitIsKeyword(this, AwaitIsModuleKeyword);
ParseNode* pn = statementList(YieldIsKeyword);
ParseNode* pn = statementList(YieldIsName);
if (!pn)
return null();
@ -5668,7 +5668,7 @@ Parser<ParseHandler, CharT>::exportFunctionDeclaration(uint32_t begin, uint32_t
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_FUNCTION));
Node kid = functionStmt(toStringStart, YieldIsKeyword, NameRequired, asyncKind);
Node kid = functionStmt(toStringStart, YieldIsName, NameRequired, asyncKind);
if (!kid)
return null();
@ -5694,7 +5694,7 @@ Parser<ParseHandler, CharT>::exportClassDeclaration(uint32_t begin)
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_CLASS));
Node kid = classDefinition(YieldIsKeyword, ClassStatement, NameRequired);
Node kid = classDefinition(YieldIsName, ClassStatement, NameRequired);
if (!kid)
return null();
@ -5749,7 +5749,7 @@ Parser<ParseHandler, CharT>::exportDefaultFunctionDeclaration(uint32_t begin,
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_FUNCTION));
Node kid = functionStmt(toStringStart, YieldIsKeyword, AllowDefaultName, asyncKind);
Node kid = functionStmt(toStringStart, YieldIsName, AllowDefaultName, asyncKind);
if (!kid)
return null();
@ -5772,7 +5772,7 @@ Parser<ParseHandler, CharT>::exportDefaultClassDeclaration(uint32_t begin)
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_CLASS));
Node kid = classDefinition(YieldIsKeyword, ClassStatement, AllowDefaultName);
Node kid = classDefinition(YieldIsName, ClassStatement, AllowDefaultName);
if (!kid)
return null();
@ -5800,7 +5800,7 @@ Parser<ParseHandler, CharT>::exportDefaultAssignExpr(uint32_t begin)
if (!noteDeclaredName(name, DeclarationKind::Const, pos()))
return null();
Node kid = assignExpr(InAllowed, YieldIsKeyword, TripledotProhibited);
Node kid = assignExpr(InAllowed, YieldIsName, TripledotProhibited);
if (!kid)
return null();
if (!matchOrInsertSemicolonAfterExpression())