Reorganize new.target tests (#642)
This commit is contained in:
parent
2f50fd00c3
commit
77bdb9ae3e
@ -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();
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:13)"
|
||||
}
|
||||
3
test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json
vendored
Normal file
3
test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "new.target can only be used in functions (1:12)"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user