Reorganize new.target tests (#642)

This commit is contained in:
Brian Ng 2017-07-20 16:17:40 -05:00 committed by GitHub
parent 2f50fd00c3
commit 77bdb9ae3e
10 changed files with 8 additions and 6 deletions

View File

@ -978,9 +978,11 @@ export default class ExpressionParser extends LValParser {
return node;
}
// New's precedence is slightly tricky. It must allow its argument
// to be a `[]` or dot subscript expression, but not a call — at
// least, not without wrapping it in parentheses. Thus, it uses the
// New's precedence is slightly tricky. It must allow its argument to
// be a `[]` or dot subscript expression, but not a call — at least,
// not without wrapping it in parentheses. Thus, it uses the noCalls
// argument to parseSubscripts to prevent it from consuming the
// argument list.
parseNew(): N.NewExpression | N.MetaProperty {
const node = this.startNode();

View File

@ -1,3 +0,0 @@
{
"throws": "Unexpected token (1:13)"
}

View File

@ -0,0 +1,3 @@
{
"throws": "new.target can only be used in functions (1:12)"
}