mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1233120 - Check token after static in class declaration. r=jwalden
This commit is contained in:
parent
09efe1e0a3
commit
1a9d524f0b
@ -6780,6 +6780,13 @@ Parser<FullParseHandler>::classDefinition(YieldHandling yieldHandling,
|
||||
if (tt == TOK_NAME && tokenStream.currentName() == context->names().static_) {
|
||||
if (!tokenStream.peekToken(&tt, TokenStream::KeywordIsName))
|
||||
return null();
|
||||
if (tt == TOK_RC) {
|
||||
tokenStream.consumeKnownToken(tt, TokenStream::KeywordIsName);
|
||||
report(ParseError, false, null(), JSMSG_UNEXPECTED_TOKEN,
|
||||
"property name", TokenKindToDesc(tt));
|
||||
return null();
|
||||
}
|
||||
|
||||
if (tt != TOK_LP) {
|
||||
if (!checkUnescapedName())
|
||||
return null();
|
||||
@ -9249,8 +9256,7 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling, Node propList,
|
||||
if (!tokenStream.getToken(<ok, TokenStream::KeywordIsName))
|
||||
return null();
|
||||
|
||||
// TOK_RC should be handled in caller.
|
||||
MOZ_ASSERT(ltok != TOK_RC);
|
||||
MOZ_ASSERT(ltok != TOK_RC, "caller should have handled TOK_RC");
|
||||
|
||||
bool isGenerator = false;
|
||||
if (ltok == TOK_MUL) {
|
||||
|
@ -479,6 +479,8 @@ function testClasses() {
|
||||
assertClassError("class NAME { static *y", SyntaxError);
|
||||
assertClassError("class NAME { static get", SyntaxError);
|
||||
assertClassError("class NAME { static get y", SyntaxError);
|
||||
assertClassError("class NAME { static }", SyntaxError);
|
||||
assertClassError("class NAME { static ;", SyntaxError);
|
||||
assertClassError("class NAME extends", SyntaxError);
|
||||
assertClassError("class NAME { constructor() { super", SyntaxError);
|
||||
assertClassError("class NAME { constructor() { super.", SyntaxError);
|
||||
|
Loading…
Reference in New Issue
Block a user