diff --git a/src/parser/expression.js b/src/parser/expression.js index f176b1711a..56bf019561 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -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(); diff --git a/test/fixtures/es2015/uncategorised/337/actual.js b/test/fixtures/es2015/meta-properties/new-invalid-prop/actual.js similarity index 100% rename from test/fixtures/es2015/uncategorised/337/actual.js rename to test/fixtures/es2015/meta-properties/new-invalid-prop/actual.js diff --git a/test/fixtures/es2015/uncategorised/337/options.json b/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json similarity index 100% rename from test/fixtures/es2015/uncategorised/337/options.json rename to test/fixtures/es2015/meta-properties/new-invalid-prop/options.json diff --git a/test/fixtures/es2015/uncategorised/336/actual.js b/test/fixtures/es2015/meta-properties/new-target-invalid/actual.js similarity index 100% rename from test/fixtures/es2015/uncategorised/336/actual.js rename to test/fixtures/es2015/meta-properties/new-target-invalid/actual.js diff --git a/test/fixtures/es2015/uncategorised/336/options.json b/test/fixtures/es2015/meta-properties/new-target-invalid/options.json similarity index 100% rename from test/fixtures/es2015/uncategorised/336/options.json rename to test/fixtures/es2015/meta-properties/new-target-invalid/options.json diff --git a/test/fixtures/es2015/uncategorised/394/actual.js b/test/fixtures/es2015/meta-properties/new-target/actual.js similarity index 100% rename from test/fixtures/es2015/uncategorised/394/actual.js rename to test/fixtures/es2015/meta-properties/new-target/actual.js diff --git a/test/fixtures/es2015/uncategorised/394/expected.json b/test/fixtures/es2015/meta-properties/new-target/expected.json similarity index 100% rename from test/fixtures/es2015/uncategorised/394/expected.json rename to test/fixtures/es2015/meta-properties/new-target/expected.json diff --git a/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/options.json b/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/options.json deleted file mode 100644 index 27f6e27de8..0000000000 --- a/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:13)" -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/actual.js b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-meta-property/.invalid-new-target/actual.js rename to test/fixtures/esprima/es2015-meta-property/invalid-new-target/actual.js diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json new file mode 100644 index 0000000000..44194382de --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json @@ -0,0 +1,3 @@ +{ + "throws": "new.target can only be used in functions (1:12)" +}