зеркало из https://github.com/mozilla/narcissus.git
accept IdentifierName in property-name context
This commit is contained in:
Родитель
81f4c6fe58
Коммит
8f5aea80cb
|
@ -927,6 +927,18 @@ Narcissus.parser = (function() {
|
|||
return new Node(t, { type: IDENTIFIER });
|
||||
}
|
||||
|
||||
/*
|
||||
* IdentifierName :: (tokenizer) -> IDENTIFIER node
|
||||
*/
|
||||
function IdentifierName(t) {
|
||||
if (t.match(IDENTIFIER))
|
||||
return new Node(t, { type: IDENTIFIER });
|
||||
t.get();
|
||||
if (t.token.value in definitions.keywords)
|
||||
return new Node(t, { type: IDENTIFIER });
|
||||
throw t.newSyntaxError("missing IdentifierName");
|
||||
}
|
||||
|
||||
/*
|
||||
* QualifiedPath :: (tokenizer, compiler context) -> (IDENTIFIER | DOT) node
|
||||
*/
|
||||
|
@ -1597,8 +1609,7 @@ Narcissus.parser = (function() {
|
|||
case DOT:
|
||||
n2 = new Node(t);
|
||||
n2.push(n);
|
||||
t.mustMatch(IDENTIFIER);
|
||||
n2.push(new Node(t));
|
||||
n2.push(IdentifierName(t));
|
||||
break;
|
||||
|
||||
case LEFT_BRACKET:
|
||||
|
|
Загрузка…
Ссылка в новой задаче