From 5b40845afe22fb0e2dad84a1dbad5d2dadf009b1 Mon Sep 17 00:00:00 2001
From: Matthew Whitworth
Date: Mon, 21 Oct 2019 16:39:03 +0100
Subject: [PATCH 001/648] add test and fix for string literal case (#10578)
---
.../src/transformer-legacy.js | 5 +++-
.../string-literal-properties/exec.js | 29 +++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/legacy-class-prototype-properties/string-literal-properties/exec.js
diff --git a/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js b/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
index 53cfe47df91d..d6160db14c55 100644
--- a/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
+++ b/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
@@ -281,7 +281,10 @@ export default {
path.replaceWith(
t.callExpression(state.addHelper("initializerDefineProperty"), [
t.cloneNode(path.get("left.object").node),
- t.stringLiteral(path.get("left.property").node.name),
+ t.stringLiteral(
+ path.get("left.property").node.name ||
+ path.get("left.property").node.value,
+ ),
t.cloneNode(path.get("right.arguments")[0].node),
t.cloneNode(path.get("right.arguments")[1].node),
]),
diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-class-prototype-properties/string-literal-properties/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-class-prototype-properties/string-literal-properties/exec.js
new file mode 100644
index 000000000000..c3e4ca274083
--- /dev/null
+++ b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-class-prototype-properties/string-literal-properties/exec.js
@@ -0,0 +1,29 @@
+function dec(target, name, descriptor) {
+ expect(target).toBeTruthy();
+ expect(typeof name).toBe("string");
+ expect(typeof descriptor).toBe("object");
+
+ target.decoratedProps = (target.decoratedProps || []).concat([name]);
+
+ return descriptor;
+}
+
+class Example {
+ @dec "a-prop";
+}
+
+let inst = new Example();
+
+expect(Example.prototype).toHaveProperty("decoratedProps");
+expect(inst.decoratedProps).toEqual([
+ "a-prop"
+]);
+
+expect(inst).toHaveProperty("a-prop");
+expect(inst["a-prop"]).toBeUndefined();
+
+const descs = Object.getOwnPropertyDescriptors(inst);
+
+expect(descs["a-prop"].enumerable).toBeTruthy();
+expect(descs["a-prop"].writable).toBeTruthy();
+expect(descs["a-prop"].configurable).toBeTruthy();
From 1770dace348da8b5833ff793a1f5c92d9f12052c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Tue, 22 Oct 2019 18:23:20 -0400
Subject: [PATCH 002/648] chore: test against Node.js 13 (#10591)
---
.travis.yml | 4 ++--
package.json | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 4b897a8e1a1a..0fff1345e8ee 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,8 +27,8 @@ matrix:
include:
- node_js: "node"
env: JOB=lint
- # We test the latest version on circleci
- - node_js: "11"
+ # We test the Node.js 12 on circleci
+ - node_js: "13"
# Move `windows` build to be the third since it is slow
- os: windows
node_js: "node"
diff --git a/package.json b/package.json
index 1fbd8da7d90c..a420748f1135 100644
--- a/package.json
+++ b/package.json
@@ -76,7 +76,7 @@
"@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates"
},
"engines": {
- "node": ">= 6.9.0 < 13.0.0",
+ "node": ">= 6.9.0 < 14.0.0",
"npm": ">= 3.x <= 6.x",
"yarn": ">=0.27.5 || >=1.0.0-20170811"
},
From 562b6c3bbbebfa3972799bfa871275b80502517f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Tue, 22 Oct 2019 21:35:02 -0400
Subject: [PATCH 003/648] chore: replace outdated travis-ci.org badges [ci
skip] (#10593)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 51315b7a7e12..190b93622139 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
-
+
From fce1b741054ef52d0c9710e6dfd8ec78b3c6e618 Mon Sep 17 00:00:00 2001
From: Brian Ng
Date: Thu, 24 Oct 2019 08:28:01 -0500
Subject: [PATCH 004/648] Test node@13 on CircleCI (#10600)
---
.circleci/config.yml | 3 +--
.travis.yml | 14 +++++++-------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index dfa4bf21bf96..691613f6de4b 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -43,7 +43,7 @@ jobs:
test:
working_directory: ~/babel
docker:
- - image: circleci/node:12
+ - image: circleci/node:13
steps:
- checkout
- restore-cache: *restore-yarn-cache
@@ -107,7 +107,6 @@ jobs:
cat ~/test262.tap | $(npm bin)/tap-mocha-reporter spec || true
<<: *test262_workdir
-
workflows:
version: 2
test:
diff --git a/.travis.yml b/.travis.yml
index 0fff1345e8ee..d9fce0df2bd8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,16 +27,16 @@ matrix:
include:
- node_js: "node"
env: JOB=lint
- # We test the Node.js 12 on circleci
- - node_js: "13"
- # Move `windows` build to be the third since it is slow
+ # We test the latest version on circleci
+ - node_js: "12"
+ # Move `windows` build to be the third since it is slow
- os: windows
node_js: "node"
env:
- - JOB=test
- # https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288/9
- - YARN_GPG=no
- # Continue node_js matrix
+ - JOB=test
+ # https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288/9
+ - YARN_GPG=no
+ # Continue node_js matrix
- node_js: "6"
- node_js: "10"
- node_js: "8"
From 43065a9e24b42cf34a6da48b62576ab5909dcae2 Mon Sep 17 00:00:00 2001
From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
Date: Thu, 24 Oct 2019 23:14:44 +0200
Subject: [PATCH 005/648] =?UTF-8?q?fix(babel=E2=80=91helpers/interopRequir?=
=?UTF-8?q?eWildcard):=20Avoid=C2=A0double=C2=A0nullis=E2=80=A6=20(#10585)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix(babel‑helpers/interopRequireWildcard): Avoid double nullish check
* Update fixtures
---
packages/babel-helpers/src/helpers.js | 22 +++++++++----------
.../misc/copy-getters-setters-star/output.js | 2 +-
.../output.js | 2 +-
.../dynamic-import/modules-amd/output.js | 2 +-
.../dynamic-import/modules-cjs/output.js | 2 +-
5 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js
index 32cbee4fc000..23416e002296 100644
--- a/packages/babel-helpers/src/helpers.js
+++ b/packages/babel-helpers/src/helpers.js
@@ -630,18 +630,16 @@ helpers.interopRequireWildcard = helper("7.0.0-beta.0")`
}
var newObj = {};
- if (obj != null) {
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- var desc = hasPropertyDescriptor
- ? Object.getOwnPropertyDescriptor(obj, key)
- : null;
- if (desc && (desc.get || desc.set)) {
- Object.defineProperty(newObj, key, desc);
- } else {
- newObj[key] = obj[key];
- }
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ var desc = hasPropertyDescriptor
+ ? Object.getOwnPropertyDescriptor(obj, key)
+ : null;
+ if (desc && (desc.get || desc.set)) {
+ Object.defineProperty(newObj, key, desc);
+ } else {
+ newObj[key] = obj[key];
}
}
}
diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/output.js
index f17e16f9dacf..015566b41f7a 100644
--- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/output.js
+++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/output.js
@@ -11,4 +11,4 @@ exports.foo = foo;
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/output.js b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/output.js
index d71f23bfef4b..a7f2edabb858 100644
--- a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/output.js
+++ b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/output.js
@@ -4,7 +4,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
Promise.resolve().then(function () {
return _interopRequireWildcard(require("foo"));
diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/output.js b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/output.js
index 000247047cd4..f1ca949bbcb1 100644
--- a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/output.js
+++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/output.js
@@ -3,7 +3,7 @@ define(["require"], function (_require) {
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
new Promise(function (_resolve, _reject) {
return _require(["foo"], function (imported) {
diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/output.js b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/output.js
index d71f23bfef4b..a7f2edabb858 100644
--- a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/output.js
+++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/output.js
@@ -4,7 +4,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
Promise.resolve().then(function () {
return _interopRequireWildcard(require("foo"));
From 9ada30c2078d4e98c275e0e204ddfae64f3eba48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?=
Date: Sun, 27 Oct 2019 20:09:03 +0100
Subject: [PATCH 006/648] Use .find instead of .filter to get targetPath in
ImportInjector (#10608)
---
packages/babel-helper-module-imports/src/import-injector.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/babel-helper-module-imports/src/import-injector.js b/packages/babel-helper-module-imports/src/import-injector.js
index 0e38f9188ab9..59375b6c9cac 100644
--- a/packages/babel-helper-module-imports/src/import-injector.js
+++ b/packages/babel-helper-module-imports/src/import-injector.js
@@ -417,10 +417,10 @@ export default class ImportInjector {
node._blockHoist = blockHoist;
});
- const targetPath = this._programPath.get("body").filter(p => {
+ const targetPath = this._programPath.get("body").find(p => {
const val = p.node._blockHoist;
return Number.isFinite(val) && val < 4;
- })[0];
+ });
if (targetPath) {
targetPath.insertBefore(statements);
From 01927babe2813daf9cd47c36cd99218b947692c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Tue, 29 Oct 2019 11:23:59 -0400
Subject: [PATCH 007/648] chore: update web.immediate support fixtures (#10612)
---
.../fixtures/debug/entry-corejs3-specific-targets/stdout.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt
index a1a20c2c2999..cda9f2bec5f3 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt
@@ -246,7 +246,7 @@ Using polyfills with `entry` option:
es.weak-set { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
web.dom-collections.for-each { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
web.dom-collections.iterator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
- web.immediate { "chrome":"54", "firefox":"49", "ios":"9", "safari":"7" }
+ web.immediate { "chrome":"54", "edge":"13", "firefox":"49", "ios":"9", "safari":"7" }
web.queue-microtask { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
web.url { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
web.url.to-json { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
From b6ef9689b26b54ff9d7ef80780638386f056fbd2 Mon Sep 17 00:00:00 2001
From: gr <13141462+gonzarodriguezt@users.noreply.github.com>
Date: Tue, 29 Oct 2019 13:56:05 -0300
Subject: [PATCH 008/648] [parser] Parse only modifiers of actual methods
(#10594)
* Parse only modifiers of actual methods
* Throw question token if is used before the real name
---
packages/babel-parser/src/parser/statement.js | 5 +
.../class/async-named-properties/input.ts | 4 +
.../class/async-named-properties/output.json | 221 ++++++++++++++++++
.../class/optional-async-error/input.js | 4 +
.../class/optional-async-error/options.json | 3 +
5 files changed, 237 insertions(+)
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/async-named-properties/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/optional-async-error/input.js
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/optional-async-error/options.json
diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js
index 81e310debd7b..d926d51c1ef0 100644
--- a/packages/babel-parser/src/parser/statement.js
+++ b/packages/babel-parser/src/parser/statement.js
@@ -1348,6 +1348,7 @@ export default class StatementParser extends ExpressionParser {
const isPrivate = key.type === "PrivateName";
// Check the key is not a computed expression or string literal.
const isSimple = key.type === "Identifier";
+ const maybeQuestionTokenStart = this.state.start;
this.parsePostMemberNameModifiers(publicMember);
@@ -1403,6 +1404,10 @@ export default class StatementParser extends ExpressionParser {
// an async method
const isGenerator = this.eat(tt.star);
+ if (publicMember.optional) {
+ this.unexpected(maybeQuestionTokenStart);
+ }
+
method.kind = "method";
// The so-called parsed name would have been "async": get the real name.
this.parseClassPropertyName(method);
diff --git a/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/input.ts b/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/input.ts
new file mode 100644
index 000000000000..1e0af756a626
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/input.ts
@@ -0,0 +1,4 @@
+class A {
+ async?(): void
+ async?: boolean
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json b/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json
new file mode 100644
index 000000000000..e0ac8a5907fa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json
@@ -0,0 +1,221 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "TSDeclareMethod",
+ "start": 12,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "async"
+ },
+ "name": "async"
+ },
+ "computed": false,
+ "optional": true,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 20,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSVoidKeyword",
+ "start": 22,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "ClassProperty",
+ "start": 29,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ },
+ "identifierName": "async"
+ },
+ "name": "async"
+ },
+ "computed": false,
+ "optional": true,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 35,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSBooleanKeyword",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ }
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/optional-async-error/input.js b/packages/babel-parser/test/fixtures/typescript/class/optional-async-error/input.js
new file mode 100644
index 000000000000..01d6018a50d2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/optional-async-error/input.js
@@ -0,0 +1,4 @@
+class B { }
+class A extends B {
+ async? method(val: string): Promise;
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/optional-async-error/options.json b/packages/babel-parser/test/fixtures/typescript/class/optional-async-error/options.json
new file mode 100644
index 000000000000..8dde42aa3f55
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/optional-async-error/options.json
@@ -0,0 +1,3 @@
+{
+ "throws": "Unexpected token (3:9)"
+}
\ No newline at end of file
From f1bc6c4e18dbff8aad8e0b53d80c787c9dc9870c Mon Sep 17 00:00:00 2001
From: Simen Bekkhus
Date: Tue, 29 Oct 2019 18:23:54 +0100
Subject: [PATCH 009/648] =?UTF-8?q?feat:=20if=20code=20frame=20error=20is?=
=?UTF-8?q?=20on=20a=20single=20line,=20highlight=20the=20w=E2=80=A6=20(#1?=
=?UTF-8?q?0361)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat: if code frame error is on a single line, highlight the whole path
* flow
---
.../src/transformation/file/file.js | 23 +++++++++++++++----
.../src/transformation/plugin-pass.js | 10 ++------
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/packages/babel-core/src/transformation/file/file.js b/packages/babel-core/src/transformation/file/file.js
index 1aa6070c73c2..ed86452c64ff 100644
--- a/packages/babel-core/src/transformation/file/file.js
+++ b/packages/babel-core/src/transformation/file/file.js
@@ -19,6 +19,17 @@ const errorVisitor = {
},
};
+export type NodeLocation = {
+ loc?: {
+ end?: { line: number, column: number },
+ start: { line: number, column: number },
+ },
+ _loc?: {
+ end?: { line: number, column: number },
+ start: { line: number, column: number },
+ },
+};
+
export default class File {
_map: Map = new Map();
opts: Object;
@@ -250,10 +261,7 @@ export default class File {
}
buildCodeFrameError(
- node: ?{
- loc?: { start: { line: number, column: number } },
- _loc?: { start: { line: number, column: number } },
- },
+ node: ?NodeLocation,
msg: string,
Error: typeof Error = SyntaxError,
): Error {
@@ -285,6 +293,13 @@ export default class File {
line: loc.start.line,
column: loc.start.column + 1,
},
+ end:
+ loc.end && loc.start.line === loc.end.line
+ ? {
+ line: loc.end.line,
+ column: loc.end.column + 1,
+ }
+ : undefined,
},
{ highlightCode },
);
diff --git a/packages/babel-core/src/transformation/plugin-pass.js b/packages/babel-core/src/transformation/plugin-pass.js
index 6e62c42bc786..e11f97804745 100644
--- a/packages/babel-core/src/transformation/plugin-pass.js
+++ b/packages/babel-core/src/transformation/plugin-pass.js
@@ -1,6 +1,7 @@
// @flow
import type File from "./file/file";
+import type NodeLocation from "./file/file";
export default class PluginPass {
_map: Map = new Map();
@@ -47,14 +48,7 @@ export default class PluginPass {
return this.file.getModuleName();
}
- buildCodeFrameError(
- node: ?{
- loc?: { start: { line: number, column: number } },
- _loc?: { start: { line: number, column: number } },
- },
- msg: string,
- Error?: typeof Error,
- ) {
+ buildCodeFrameError(node: ?NodeLocation, msg: string, Error?: typeof Error) {
return this.file.buildCodeFrameError(node, msg, Error);
}
}
From 1d1fab4ea22ee84703e860dbe9360c94190fe26b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Tue, 29 Oct 2019 18:27:54 +0100
Subject: [PATCH 010/648] [parser] Add support for private fields in TypeScript
(#10483)
* [parser] Add support for private fields in TypeScript
* Fix flow
---
.../src/plugins/typescript/index.js | 33 +-
packages/babel-parser/src/types.js | 9 +-
.../fixtures/typescript/class/options.json | 2 +-
.../private-fields-modifier-abstract/input.ts | 3 +
.../options.json | 3 +
.../private-fields-modifier-private/input.ts | 3 +
.../options.json | 3 +
.../input.ts | 3 +
.../options.json | 3 +
.../private-fields-modifier-public/input.ts | 3 +
.../options.json | 3 +
.../private-fields-modifier-readonly/input.ts | 4 +
.../output.json | 215 +++++++++
.../class/private-fields-static/input.ts | 4 +
.../class/private-fields-static/output.json | 213 +++++++++
.../typescript/class/private-fields/input.ts | 7 +
.../class/private-fields/output.json | 424 ++++++++++++++++++
17 files changed, 931 insertions(+), 4 deletions(-)
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-static/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json
diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js
index 8adf82f1568a..187dd540520a 100644
--- a/packages/babel-parser/src/plugins/typescript/index.js
+++ b/packages/babel-parser/src/plugins/typescript/index.js
@@ -1868,7 +1868,7 @@ export default (superClass: Class): Class =>
}
parsePostMemberNameModifiers(
- methodOrProp: N.ClassMethod | N.ClassProperty,
+ methodOrProp: N.ClassMethod | N.ClassProperty | N.ClassPrivateProperty,
): void {
const optional = this.eat(tt.question);
if (optional) methodOrProp.optional = true;
@@ -2007,16 +2007,45 @@ export default (superClass: Class): Class =>
if (typeParameters) node.typeParameters = typeParameters;
}
- parseClassProperty(node: N.ClassProperty): N.ClassProperty {
+ parseClassPropertyAnnotation(
+ node: N.ClassProperty | N.ClassPrivateProperty,
+ ): void {
if (!node.optional && this.eat(tt.bang)) {
node.definite = true;
}
const type = this.tsTryParseTypeAnnotation();
if (type) node.typeAnnotation = type;
+ }
+
+ parseClassProperty(node: N.ClassProperty): N.ClassProperty {
+ this.parseClassPropertyAnnotation(node);
return super.parseClassProperty(node);
}
+ parseClassPrivateProperty(
+ node: N.ClassPrivateProperty,
+ ): N.ClassPrivateProperty {
+ // $FlowIgnore
+ if (node.abstract) {
+ this.raise(
+ node.start,
+ "Private elements cannot have the 'abstract' modifier.",
+ );
+ }
+
+ // $FlowIgnore
+ if (node.accessibility) {
+ this.raise(
+ node.start,
+ `Private elements cannot have an accessibility modifier ('${node.accessibility}')`,
+ );
+ }
+
+ this.parseClassPropertyAnnotation(node);
+ return super.parseClassPrivateProperty(node);
+ }
+
pushClassMethod(
classBody: N.ClassBody,
method: N.ClassMethod,
diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js
index 8560da3a3f73..f5b34a2db0a3 100644
--- a/packages/babel-parser/src/types.js
+++ b/packages/babel-parser/src/types.js
@@ -762,7 +762,14 @@ export type ClassPrivateProperty = NodeBase & {
value: ?Expression, // TODO: Not in spec that this is nullable.
static: boolean,
computed: false,
- typeAnnotation?: ?TypeAnnotation, // TODO: Not in spec
+
+ // Flow and Typescript
+ typeAnnotation?: ?TypeAnnotationBase,
+
+ // TypeScript only
+ optional?: true,
+ definite?: true,
+ readonly?: true,
};
export type OptClassDeclaration = ClassBase &
diff --git a/packages/babel-parser/test/fixtures/typescript/class/options.json b/packages/babel-parser/test/fixtures/typescript/class/options.json
index 9f3a0c2c0ff1..fff045d3a491 100644
--- a/packages/babel-parser/test/fixtures/typescript/class/options.json
+++ b/packages/babel-parser/test/fixtures/typescript/class/options.json
@@ -1,4 +1,4 @@
{
"sourceType": "module",
- "plugins": ["typescript", "classProperties"]
+ "plugins": ["typescript", "classProperties", "classPrivateProperties"]
}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/input.ts b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/input.ts
new file mode 100644
index 000000000000..7cf85ea5ec29
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/input.ts
@@ -0,0 +1,3 @@
+abstract class A {
+ abstract #a;
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json
new file mode 100644
index 000000000000..7c4adceba22a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json
@@ -0,0 +1,3 @@
+{
+ "throws": "Private elements cannot have the 'abstract' modifier. (2:2)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/input.ts b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/input.ts
new file mode 100644
index 000000000000..a4472caceb86
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/input.ts
@@ -0,0 +1,3 @@
+class A {
+ private #a;
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json
new file mode 100644
index 000000000000..a183ce2e7550
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json
@@ -0,0 +1,3 @@
+{
+ "throws": "Private elements cannot have an accessibility modifier ('private') (2:2)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/input.ts b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/input.ts
new file mode 100644
index 000000000000..0f35b844a7be
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/input.ts
@@ -0,0 +1,3 @@
+class A {
+ protected #a;
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json
new file mode 100644
index 000000000000..e6c1bebe1ab9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json
@@ -0,0 +1,3 @@
+{
+ "throws": "Private elements cannot have an accessibility modifier ('protected') (2:2)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/input.ts b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/input.ts
new file mode 100644
index 000000000000..59a236000e60
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/input.ts
@@ -0,0 +1,3 @@
+class A {
+ public #a;
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json
new file mode 100644
index 000000000000..7fb90279eae1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json
@@ -0,0 +1,3 @@
+{
+ "throws": "Private elements cannot have an accessibility modifier ('public') (2:2)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/input.ts b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/input.ts
new file mode 100644
index 000000000000..355def79b8b7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/input.ts
@@ -0,0 +1,4 @@
+class A {
+ readonly #a;
+ readonly #b: string;
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json
new file mode 100644
index 000000000000..f883e0b00b2a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json
@@ -0,0 +1,215 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 12,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "readonly": true,
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ },
+ "value": null
+ },
+ {
+ "type": "ClassProperty",
+ "start": 27,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "readonly": true,
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 36,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 38,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 40,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ }
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/input.ts b/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/input.ts
new file mode 100644
index 000000000000..4725b09bea74
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/input.ts
@@ -0,0 +1,4 @@
+class A {
+ static #x;
+ static #y: string;
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json
new file mode 100644
index 000000000000..dcb6ab198f52
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json
@@ -0,0 +1,213 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 12,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "static": true,
+ "key": {
+ "type": "PrivateName",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ },
+ "value": null
+ },
+ {
+ "type": "ClassPrivateProperty",
+ "start": 25,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "static": true,
+ "key": {
+ "type": "PrivateName",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 34,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 36,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ }
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields/input.ts b/packages/babel-parser/test/fixtures/typescript/class/private-fields/input.ts
new file mode 100644
index 000000000000..30c6024e99ce
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields/input.ts
@@ -0,0 +1,7 @@
+class A {
+ #a: string;
+ #b?;
+ #c?: number;
+ #d!;
+ #e!: boolean;
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json
new file mode 100644
index 000000000000..67a50c2c16ff
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json
@@ -0,0 +1,424 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 12,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 14,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 16,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ }
+ },
+ "value": null
+ },
+ {
+ "type": "ClassPrivateProperty",
+ "start": 26,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 3
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ },
+ "optional": true,
+ "value": null
+ },
+ {
+ "type": "ClassPrivateProperty",
+ "start": 33,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 3
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ }
+ },
+ "optional": true,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 5
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "start": 38,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ }
+ }
+ },
+ "value": null
+ },
+ {
+ "type": "ClassPrivateProperty",
+ "start": 48,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 48,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 3
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ },
+ "identifierName": "d"
+ },
+ "name": "d"
+ }
+ },
+ "definite": true,
+ "value": null
+ },
+ {
+ "type": "ClassPrivateProperty",
+ "start": 55,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 15
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 55,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 56,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 3
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ },
+ "identifierName": "e"
+ },
+ "name": "e"
+ }
+ },
+ "definite": true,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 58,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 14
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSBooleanKeyword",
+ "start": 60,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 14
+ }
+ }
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
From 4e5ac1fd5c361ea992191c28088a78241d6c9adf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BD=AD=E9=A9=B0?=
Date: Wed, 30 Oct 2019 01:28:52 +0800
Subject: [PATCH 011/648] Fix #8326, add back --quiet option. (#10399)
* Fix issue #8326, quiet the @babel/cli with --quiet cli option.
* --quiet and --verbose options now conflict with each other.
---
packages/babel-cli/src/babel/dir.js | 12 +++++++-----
packages/babel-cli/src/babel/options.js | 14 +++++++++++++-
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js
index 32136b78f02a..1ce3bfdf2bbd 100644
--- a/packages/babel-cli/src/babel/dir.js
+++ b/packages/babel-cli/src/babel/dir.js
@@ -129,11 +129,13 @@ export default async function({
compiledFiles += await handle(filename);
}
- console.log(
- `Successfully compiled ${compiledFiles} ${
- compiledFiles !== 1 ? "files" : "file"
- } with Babel.`,
- );
+ if (!cliOptions.quiet) {
+ console.log(
+ `Successfully compiled ${compiledFiles} ${
+ compiledFiles !== 1 ? "files" : "file"
+ } with Babel.`,
+ );
+ }
}
if (cliOptions.watch) {
diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js
index 897c05ba16da..9425c510b451 100644
--- a/packages/babel-cli/src/babel/options.js
+++ b/packages/babel-cli/src/babel/options.js
@@ -144,7 +144,14 @@ commander.option(
"--include-dotfiles",
"Include dotfiles when compiling and copying non-compilable files",
);
-commander.option("--verbose", "Log everything");
+commander.option(
+ "--verbose",
+ "Log everything. This option conflicts with --quiet",
+);
+commander.option(
+ "--quiet",
+ "Don't log anything. This option conflicts with --verbose",
+);
commander.option(
"--delete-dir-on-start",
"Delete the out directory before compilation",
@@ -207,6 +214,10 @@ export default function parseArgv(args: Array): CmdOptions | null {
errors.push("--delete-dir-on-start requires --out-dir");
}
+ if (commander.verbose && commander.quiet) {
+ errors.push("--verbose and --quiet cannot be used together");
+ }
+
if (
!commander.outDir &&
filenames.length === 0 &&
@@ -282,6 +293,7 @@ export default function parseArgv(args: Array): CmdOptions | null {
copyFiles: opts.copyFiles,
includeDotfiles: opts.includeDotfiles,
verbose: opts.verbose,
+ quiet: opts.quiet,
deleteDirOnStart: opts.deleteDirOnStart,
sourceMapTarget: opts.sourceMapTarget,
},
From be0fcaaf49ae2c91700e3d74ac1dbb07b4cc2ab8 Mon Sep 17 00:00:00 2001
From: Bogdan Chadkin
Date: Tue, 29 Oct 2019 19:29:45 +0200
Subject: [PATCH 012/648] Make dir for babel --out-file (#8622)
* Make dir for babel --out-file
Currently there's unexpected regression after upgrade from babel 6.
On creating file with any depth like dist/index.js the error about
not existing directory is thrown.
In this diff I modified babel-cli to create deep directory for out-file
command.
I also replaced `mkdirp` with more supported `make-dir` package which
also have official promise support.
* Fix test
---
packages/babel-cli/package.json | 2 +-
packages/babel-cli/src/babel/dir.js | 4 ++--
packages/babel-cli/src/babel/file.js | 3 +++
.../babel/filename --out-file deep/in-files/script.js | 1 +
.../fixtures/babel/filename --out-file deep/options.json | 3 +++
.../out-files/folder/nested/script.js | 5 +++++
packages/babel-register/package.json | 2 +-
packages/babel-register/src/cache.js | 4 ++--
8 files changed, 18 insertions(+), 6 deletions(-)
create mode 100644 packages/babel-cli/test/fixtures/babel/filename --out-file deep/in-files/script.js
create mode 100644 packages/babel-cli/test/fixtures/babel/filename --out-file deep/options.json
create mode 100644 packages/babel-cli/test/fixtures/babel/filename --out-file deep/out-files/folder/nested/script.js
diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json
index 4e42d3ca83e5..7e8de8bcb9c9 100644
--- a/packages/babel-cli/package.json
+++ b/packages/babel-cli/package.json
@@ -24,7 +24,7 @@
"fs-readdir-recursive": "^1.1.0",
"glob": "^7.0.0",
"lodash": "^4.17.13",
- "mkdirp": "^0.5.1",
+ "make-dir": "^2.1.0",
"output-file-sync": "^2.0.0",
"slash": "^2.0.0",
"source-map": "^0.5.0"
diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js
index 1ce3bfdf2bbd..094f7806f90a 100644
--- a/packages/babel-cli/src/babel/dir.js
+++ b/packages/babel-cli/src/babel/dir.js
@@ -2,7 +2,7 @@
import defaults from "lodash/defaults";
import outputFileSync from "output-file-sync";
-import { sync as mkdirpSync } from "mkdirp";
+import { sync as makeDirSync } from "make-dir";
import slash from "slash";
import path from "path";
import fs from "fs";
@@ -122,7 +122,7 @@ export default async function({
util.deleteDir(cliOptions.outDir);
}
- mkdirpSync(cliOptions.outDir);
+ makeDirSync(cliOptions.outDir);
let compiledFiles = 0;
for (const filename of cliOptions.filenames) {
diff --git a/packages/babel-cli/src/babel/file.js b/packages/babel-cli/src/babel/file.js
index 7c38d3052f3d..23b0307cc884 100644
--- a/packages/babel-cli/src/babel/file.js
+++ b/packages/babel-cli/src/babel/file.js
@@ -4,6 +4,7 @@ import convertSourceMap from "convert-source-map";
import defaults from "lodash/defaults";
import sourceMap from "source-map";
import slash from "slash";
+import { sync as makeDirSync } from "make-dir";
import path from "path";
import fs from "fs";
@@ -89,6 +90,8 @@ export default async function({
const result = buildResult(fileResults);
if (cliOptions.outFile) {
+ makeDirSync(path.dirname(cliOptions.outFile));
+
// we've requested for a sourcemap to be written to disk
if (babelOptions.sourceMaps && babelOptions.sourceMaps !== "inline") {
const mapLoc = cliOptions.outFile + ".map";
diff --git a/packages/babel-cli/test/fixtures/babel/filename --out-file deep/in-files/script.js b/packages/babel-cli/test/fixtures/babel/filename --out-file deep/in-files/script.js
new file mode 100644
index 000000000000..4bc9539528d4
--- /dev/null
+++ b/packages/babel-cli/test/fixtures/babel/filename --out-file deep/in-files/script.js
@@ -0,0 +1 @@
+arr.map(x => x * MULTIPLIER);
diff --git a/packages/babel-cli/test/fixtures/babel/filename --out-file deep/options.json b/packages/babel-cli/test/fixtures/babel/filename --out-file deep/options.json
new file mode 100644
index 000000000000..d24719ba4a76
--- /dev/null
+++ b/packages/babel-cli/test/fixtures/babel/filename --out-file deep/options.json
@@ -0,0 +1,3 @@
+{
+ "args": ["script.js", "--out-file", "folder/nested/script.js"]
+}
diff --git a/packages/babel-cli/test/fixtures/babel/filename --out-file deep/out-files/folder/nested/script.js b/packages/babel-cli/test/fixtures/babel/filename --out-file deep/out-files/folder/nested/script.js
new file mode 100644
index 000000000000..ae4557e57bc3
--- /dev/null
+++ b/packages/babel-cli/test/fixtures/babel/filename --out-file deep/out-files/folder/nested/script.js
@@ -0,0 +1,5 @@
+"use strict";
+
+arr.map(function (x) {
+ return x * MULTIPLIER;
+});
diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json
index 6a768833622d..466ba1d54523 100644
--- a/packages/babel-register/package.json
+++ b/packages/babel-register/package.json
@@ -15,7 +15,7 @@
"dependencies": {
"find-cache-dir": "^2.0.0",
"lodash": "^4.17.13",
- "mkdirp": "^0.5.1",
+ "make-dir": "^2.1.0",
"pirates": "^4.0.0",
"source-map-support": "^0.5.9"
},
diff --git a/packages/babel-register/src/cache.js b/packages/babel-register/src/cache.js
index 0a2983b89aa2..b505bb4943c7 100644
--- a/packages/babel-register/src/cache.js
+++ b/packages/babel-register/src/cache.js
@@ -1,7 +1,7 @@
import path from "path";
import fs from "fs";
import os from "os";
-import { sync as mkdirpSync } from "mkdirp";
+import { sync as makeDirSync } from "make-dir";
import * as babel from "@babel/core";
import findCacheDir from "find-cache-dir";
@@ -39,7 +39,7 @@ export function save() {
}
try {
- mkdirpSync(path.dirname(FILENAME));
+ makeDirSync(path.dirname(FILENAME));
fs.writeFileSync(FILENAME, serialised);
} catch (e) {
switch (e.code) {
From f47fbd5f3946e468da0fab95d85dbe2cdfd5d85f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Tue, 29 Oct 2019 18:35:15 +0100
Subject: [PATCH 013/648] Nit: Use ?. in the example used by the proposal
readme (#10604)
---
packages/babel-helper-builder-react-jsx/src/index.js | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/packages/babel-helper-builder-react-jsx/src/index.js b/packages/babel-helper-builder-react-jsx/src/index.js
index 3602ecb8496e..fa68384f1b70 100644
--- a/packages/babel-helper-builder-react-jsx/src/index.js
+++ b/packages/babel-helper-builder-react-jsx/src/index.js
@@ -91,9 +91,7 @@ You can turn on the 'throwIfNamespace' flag to bypass this warning.`,
value.value = value.value.replace(/\n\s+/g, " ");
// "raw" JSXText should not be used from a StringLiteral because it needs to be escaped.
- if (value.extra && value.extra.raw) {
- delete value.extra.raw;
- }
+ delete value.extra?.raw;
}
if (t.isJSXNamespacedName(node.name)) {
From d248e2d1886f7891e6d14f5969d99276a6fd9284 Mon Sep 17 00:00:00 2001
From: Eugene Myunster
Date: Tue, 29 Oct 2019 10:44:01 -0700
Subject: [PATCH 014/648] moving proposalNullishCoalescingOperator and
proposalOptionalChaining to stage 3 (#10590)
---
packages/babel-standalone/src/preset-stage-1.js | 2 --
packages/babel-standalone/src/preset-stage-3.js | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/babel-standalone/src/preset-stage-1.js b/packages/babel-standalone/src/preset-stage-1.js
index 0018a48f4334..4f9d6029912b 100644
--- a/packages/babel-standalone/src/preset-stage-1.js
+++ b/packages/babel-standalone/src/preset-stage-1.js
@@ -21,9 +21,7 @@ export default (_: any, opts: Object = {}) => {
plugins: [
babelPlugins.proposalExportDefaultFrom,
babelPlugins.proposalLogicalAssignmentOperators,
- [babelPlugins.proposalOptionalChaining, { loose }],
[babelPlugins.proposalPipelineOperator, { proposal: pipelineProposal }],
- [babelPlugins.proposalNullishCoalescingOperator, { loose }],
babelPlugins.proposalDoExpressions,
],
};
diff --git a/packages/babel-standalone/src/preset-stage-3.js b/packages/babel-standalone/src/preset-stage-3.js
index 6885719f2fd2..11e9c3833b66 100644
--- a/packages/babel-standalone/src/preset-stage-3.js
+++ b/packages/babel-standalone/src/preset-stage-3.js
@@ -12,6 +12,8 @@ export default (_: any, opts: Object) => {
plugins: [
babelPlugins.syntaxDynamicImport,
babelPlugins.syntaxImportMeta,
+ [babelPlugins.proposalOptionalChaining, { loose }],
+ [babelPlugins.proposalNullishCoalescingOperator, { loose }],
[babelPlugins.proposalClassProperties, { loose }],
babelPlugins.proposalJsonStrings,
[babelPlugins.proposalPrivateMethods, { loose }],
From 4cd93ab5f3fa3367f53d526e4de84453307031cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Tue, 29 Oct 2019 18:44:32 +0100
Subject: [PATCH 015/648] [parser] Enable "exportNamespaceFrom" by default
(#10521)
---
packages/babel-parser/src/parser/statement.js | 1 -
.../export-ns-from}/ns-and-named/input.js | 0
.../export-ns-from}/ns-and-named/output.json | 0
.../export-ns-from}/ns-default/input.js | 0
.../export-ns-from}/ns-default/output.json | 0
.../export-ns-from/ns}/input.js | 0
.../export-ns-from}/ns/output.json | 0
.../es2020/export-ns-from/options.json | 3 +
.../_no-plugin/export-namespace/options.json | 4 -
.../default-and-ns/options.json | 2 +-
.../ns-and-named/options.json | 4 -
.../export-extensions/ns-default/options.json | 4 -
.../export-extensions/ns/input.js | 1 -
.../export-extensions/ns/options.json | 4 -
.../export-star-as/options.json | 2 +-
.../type-exports/star-as-from/options.json | 2 +-
.../fixtures/placeholders/export/options.json | 2 +-
.../export/star-from-2/options.json | 3 +-
.../export/star-from-2/output.json | 120 ++++++++++++++++
.../export/star-from-3/options.json | 3 +-
.../export/star-from-3/output.json | 133 ++++++++++++++++++
.../babel-parser/typings/babel-parser.d.ts | 2 +-
22 files changed, 263 insertions(+), 27 deletions(-)
rename packages/babel-parser/test/fixtures/{experimental/export-extensions => es2020/export-ns-from}/ns-and-named/input.js (100%)
rename packages/babel-parser/test/fixtures/{experimental/export-extensions => es2020/export-ns-from}/ns-and-named/output.json (100%)
rename packages/babel-parser/test/fixtures/{experimental/export-extensions => es2020/export-ns-from}/ns-default/input.js (100%)
rename packages/babel-parser/test/fixtures/{experimental/export-extensions => es2020/export-ns-from}/ns-default/output.json (100%)
rename packages/babel-parser/test/fixtures/{experimental/_no-plugin/export-namespace => es2020/export-ns-from/ns}/input.js (100%)
rename packages/babel-parser/test/fixtures/{experimental/export-extensions => es2020/export-ns-from}/ns/output.json (100%)
create mode 100644 packages/babel-parser/test/fixtures/es2020/export-ns-from/options.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/export-namespace/options.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/options.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/options.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/export-extensions/ns/input.js
delete mode 100644 packages/babel-parser/test/fixtures/experimental/export-extensions/ns/options.json
create mode 100644 packages/babel-parser/test/fixtures/placeholders/export/star-from-2/output.json
create mode 100644 packages/babel-parser/test/fixtures/placeholders/export/star-from-3/output.json
diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js
index d926d51c1ef0..6a67349b2820 100644
--- a/packages/babel-parser/src/parser/statement.js
+++ b/packages/babel-parser/src/parser/statement.js
@@ -1719,7 +1719,6 @@ export default class StatementParser extends ExpressionParser {
maybeParseExportNamespaceSpecifier(node: N.Node): boolean {
if (this.isContextual("as")) {
if (!node.specifiers) node.specifiers = [];
- this.expectPlugin("exportNamespaceFrom");
const specifier = this.startNodeAt(
this.state.lastTokStart,
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/input.js b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-and-named/input.js
similarity index 100%
rename from packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/input.js
rename to packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-and-named/input.js
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/output.json b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-and-named/output.json
similarity index 100%
rename from packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/output.json
rename to packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-and-named/output.json
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/input.js b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-default/input.js
similarity index 100%
rename from packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/input.js
rename to packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-default/input.js
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/output.json b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-default/output.json
similarity index 100%
rename from packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/output.json
rename to packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-default/output.json
diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/export-namespace/input.js b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns/input.js
similarity index 100%
rename from packages/babel-parser/test/fixtures/experimental/_no-plugin/export-namespace/input.js
rename to packages/babel-parser/test/fixtures/es2020/export-ns-from/ns/input.js
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns/output.json b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns/output.json
similarity index 100%
rename from packages/babel-parser/test/fixtures/experimental/export-extensions/ns/output.json
rename to packages/babel-parser/test/fixtures/es2020/export-ns-from/ns/output.json
diff --git a/packages/babel-parser/test/fixtures/es2020/export-ns-from/options.json b/packages/babel-parser/test/fixtures/es2020/export-ns-from/options.json
new file mode 100644
index 000000000000..2104ca43283f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2020/export-ns-from/options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/export-namespace/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/export-namespace/options.json
deleted file mode 100644
index b8b7c829daad..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/export-namespace/options.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)",
- "plugins": []
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/options.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/options.json
index 3bb54891b474..fb17f33a28b5 100644
--- a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/options.json
@@ -1,4 +1,4 @@
{
- "plugins": ["exportDefaultFrom", "exportNamespaceFrom"],
+ "plugins": ["exportDefaultFrom"],
"sourceType": "module"
}
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/options.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/options.json
deleted file mode 100644
index efa6c457adc3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/options.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["exportNamespaceFrom"]
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/options.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/options.json
deleted file mode 100644
index e32f18023916..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/options.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "plugins": ["exportNamespaceFrom"],
- "sourceType": "module"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns/input.js b/packages/babel-parser/test/fixtures/experimental/export-extensions/ns/input.js
deleted file mode 100644
index 27357f4758f9..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns/input.js
+++ /dev/null
@@ -1 +0,0 @@
-export * as A from 'test';
diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns/options.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/ns/options.json
deleted file mode 100644
index e32f18023916..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/export-extensions/ns/options.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "plugins": ["exportNamespaceFrom"],
- "sourceType": "module"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/options.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/options.json
index acd5b34be46d..698e7668500f 100644
--- a/packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/options.json
+++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/options.json
@@ -1,3 +1,3 @@
{
- "plugins": ["jsx", "flow", "exportNamespaceFrom"]
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/type-exports/star-as-from/options.json b/packages/babel-parser/test/fixtures/flow/type-exports/star-as-from/options.json
index d482b18c6cff..6a0cd1358ef1 100644
--- a/packages/babel-parser/test/fixtures/flow/type-exports/star-as-from/options.json
+++ b/packages/babel-parser/test/fixtures/flow/type-exports/star-as-from/options.json
@@ -1,5 +1,5 @@
{
"sourceType": "module",
- "plugins": ["flow", "exportNamespaceFrom"],
+ "plugins": ["flow"],
"throws": "Unexpected token (1:14)"
}
diff --git a/packages/babel-parser/test/fixtures/placeholders/export/options.json b/packages/babel-parser/test/fixtures/placeholders/export/options.json
index e7ff26ae7014..14a812b67661 100644
--- a/packages/babel-parser/test/fixtures/placeholders/export/options.json
+++ b/packages/babel-parser/test/fixtures/placeholders/export/options.json
@@ -1,4 +1,4 @@
{
- "plugins": ["placeholders", "exportDefaultFrom", "exportNamespaceFrom"],
+ "plugins": ["placeholders", "exportDefaultFrom"],
"sourceType": "module"
}
diff --git a/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/options.json b/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/options.json
index ec7b8f83c3d7..986e9cefa93e 100644
--- a/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/options.json
+++ b/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/options.json
@@ -1,5 +1,4 @@
{
"plugins": ["placeholders"],
- "sourceType": "module",
- "throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)"
+ "sourceType": "module"
}
diff --git a/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/output.json b/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/output.json
new file mode 100644
index 000000000000..b89f3e8dec86
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/output.json
@@ -0,0 +1,120 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportNamespaceSpecifier",
+ "start": 7,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "exported": {
+ "type": "Placeholder",
+ "start": 12,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "name": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "STAR"
+ },
+ "name": "STAR"
+ },
+ "expectedNode": "Identifier"
+ }
+ }
+ ],
+ "source": {
+ "type": "StringLiteral",
+ "start": 26,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "extra": {
+ "rawValue": "file",
+ "raw": "\"file\""
+ },
+ "value": "file"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/options.json b/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/options.json
index ec7b8f83c3d7..986e9cefa93e 100644
--- a/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/options.json
+++ b/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/options.json
@@ -1,5 +1,4 @@
{
"plugins": ["placeholders"],
- "sourceType": "module",
- "throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)"
+ "sourceType": "module"
}
diff --git a/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/output.json b/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/output.json
new file mode 100644
index 000000000000..2391c0c770d0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/output.json
@@ -0,0 +1,133 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportNamespaceSpecifier",
+ "start": 7,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "exported": {
+ "type": "Placeholder",
+ "start": 12,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "name": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "STAR"
+ },
+ "name": "STAR"
+ },
+ "expectedNode": "Identifier"
+ }
+ }
+ ],
+ "source": {
+ "type": "Placeholder",
+ "start": 26,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "name": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "FILE"
+ },
+ "name": "FILE"
+ },
+ "expectedNode": "StringLiteral"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts
index 371b9a4633da..575843e6d24b 100644
--- a/packages/babel-parser/typings/babel-parser.d.ts
+++ b/packages/babel-parser/typings/babel-parser.d.ts
@@ -106,7 +106,7 @@ export type ParserPlugin =
'dynamicImport' |
'estree' |
'exportDefaultFrom' |
- 'exportNamespaceFrom' |
+ 'exportNamespaceFrom' | // deprecated
'flow' |
'flowComments' |
'functionBind' |
From 38a30631115963a41f7d84ba811c9308301faa50 Mon Sep 17 00:00:00 2001
From: Tan Li Hau
Date: Wed, 30 Oct 2019 01:51:33 +0800
Subject: [PATCH 016/648] add assertions signature for TypeScript (#10543)
* add asserts predicate
* fix flow
* babel-generator for typescript assertions
* babel-types for typescript assertions
* asserts modifier as boolean
---
.../src/generators/typescript.js | 14 +-
.../arrow-function-assertion/input.js | 2 +
.../arrow-function-assertion/output.js | 3 +
.../typescript/function-assertion/input.js | 2 +
.../typescript/function-assertion/output.js | 3 +
.../src/plugins/typescript/index.js | 40 +-
.../predicate-types/output.json | 4 +-
.../assert-predicate/arrow-function/input.ts | 3 +
.../arrow-function/output.json | 610 ++++++++++++++++++
.../asserts-as-identifier/input.ts | 1 +
.../asserts-as-identifier/output.json | 166 +++++
.../assert-predicate/asserts-var/input.ts | 1 +
.../assert-predicate/asserts-var/output.json | 167 +++++
.../asserts-with-predicate/input.ts | 1 +
.../asserts-with-predicate/output.json | 197 ++++++
.../function-declaration/input.ts | 3 +
.../function-declaration/output.json | 508 +++++++++++++++
.../function/predicate-types/output.json | 8 +-
.../babel-types/src/definitions/typescript.js | 5 +-
19 files changed, 1721 insertions(+), 17 deletions(-)
create mode 100644 packages/babel-generator/test/fixtures/typescript/arrow-function-assertion/input.js
create mode 100644 packages/babel-generator/test/fixtures/typescript/arrow-function-assertion/output.js
create mode 100644 packages/babel-generator/test/fixtures/typescript/function-assertion/input.js
create mode 100644 packages/babel-generator/test/fixtures/typescript/function-assertion/output.js
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json
diff --git a/packages/babel-generator/src/generators/typescript.js b/packages/babel-generator/src/generators/typescript.js
index 4ff2fe1ad188..aa5e4ce4cde6 100644
--- a/packages/babel-generator/src/generators/typescript.js
+++ b/packages/babel-generator/src/generators/typescript.js
@@ -197,11 +197,17 @@ export function TSTypeReference(node) {
}
export function TSTypePredicate(node) {
+ if (node.assertsModifier) {
+ this.word("asserts");
+ this.space();
+ }
this.print(node.parameterName);
- this.space();
- this.word("is");
- this.space();
- this.print(node.typeAnnotation.typeAnnotation);
+ if (node.typeAnnotation) {
+ this.space();
+ this.word("is");
+ this.space();
+ this.print(node.typeAnnotation.typeAnnotation);
+ }
}
export function TSTypeQuery(node) {
diff --git a/packages/babel-generator/test/fixtures/typescript/arrow-function-assertion/input.js b/packages/babel-generator/test/fixtures/typescript/arrow-function-assertion/input.js
new file mode 100644
index 000000000000..67e467cda8ed
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/typescript/arrow-function-assertion/input.js
@@ -0,0 +1,2 @@
+(x: any): asserts x => true;
+(x: any): asserts x is boolean => true;
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/typescript/arrow-function-assertion/output.js b/packages/babel-generator/test/fixtures/typescript/arrow-function-assertion/output.js
new file mode 100644
index 000000000000..b0befa69dc24
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/typescript/arrow-function-assertion/output.js
@@ -0,0 +1,3 @@
+(x: any): asserts x => true;
+
+(x: any): asserts x is boolean => true;
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/typescript/function-assertion/input.js b/packages/babel-generator/test/fixtures/typescript/function-assertion/input.js
new file mode 100644
index 000000000000..17db65c5a77f
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/typescript/function-assertion/input.js
@@ -0,0 +1,2 @@
+function f(x: any): asserts x {}
+(function(x: any): asserts x is boolean {})
diff --git a/packages/babel-generator/test/fixtures/typescript/function-assertion/output.js b/packages/babel-generator/test/fixtures/typescript/function-assertion/output.js
new file mode 100644
index 000000000000..b55c84620cc9
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/typescript/function-assertion/output.js
@@ -0,0 +1,3 @@
+function f(x: any): asserts x {}
+
+(function (x: any): asserts x is boolean {});
\ No newline at end of file
diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js
index 187dd540520a..a47dfac29ba6 100644
--- a/packages/babel-parser/src/plugins/typescript/index.js
+++ b/packages/babel-parser/src/plugins/typescript/index.js
@@ -904,21 +904,34 @@ export default (superClass: Class): Class =>
const t: N.TsTypeAnnotation = this.startNode();
this.expect(returnToken);
+ const assertsModifier = this.tsTryParse(
+ this.tsParseTypePredicateAssertsModifier.bind(this),
+ );
+
const typePredicateVariable =
this.tsIsIdentifier() &&
this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
if (!typePredicateVariable) {
- return this.tsParseTypeAnnotation(/* eatColon */ false, t);
+ if (!assertsModifier) {
+ // : type
+ return this.tsParseTypeAnnotation(/* eatColon */ false, t);
+ }
+
+ // : asserts foo
+ const node = this.startNodeAtNode(t);
+ node.parameterName = this.parseIdentifier();
+ node.assertsModifier = assertsModifier;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
}
+ // : foo is type
const type = this.tsParseTypeAnnotation(/* eatColon */ false);
-
- const node: N.TsTypePredicate = this.startNodeAtNode(
- typePredicateVariable,
- );
+ const node = this.startNodeAtNode(t);
node.parameterName = typePredicateVariable;
node.typeAnnotation = type;
+ node.assertsModifier = assertsModifier;
t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
return this.finishNode(t, "TSTypeAnnotation");
});
@@ -946,6 +959,23 @@ export default (superClass: Class): Class =>
}
}
+ tsParseTypePredicateAssertsModifier(): boolean {
+ if (!this.tsIsIdentifier()) {
+ return false;
+ }
+
+ const id = this.parseIdentifier();
+ if (
+ id.name !== "asserts" ||
+ this.hasPrecedingLineBreak() ||
+ !this.tsIsIdentifier()
+ ) {
+ return false;
+ }
+
+ return true;
+ }
+
tsParseTypeAnnotation(
eatColon = true,
t: N.TsTypeAnnotation = this.startNode(),
diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/predicate-types/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/predicate-types/output.json
index e1f9142855b1..45239b7a0c11 100644
--- a/packages/babel-parser/test/fixtures/typescript/arrow-function/predicate-types/output.json
+++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/predicate-types/output.json
@@ -73,12 +73,12 @@
},
"typeAnnotation": {
"type": "TSTypePredicate",
- "start": 10,
+ "start": 8,
"end": 21,
"loc": {
"start": {
"line": 1,
- "column": 10
+ "column": 8
},
"end": {
"line": 1,
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/input.ts
new file mode 100644
index 000000000000..5989d8d4f2b4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/input.ts
@@ -0,0 +1,3 @@
+const assert1 = (value: unknown): asserts value is string => {}
+const assert2 = (value: unknown): asserts value => {}
+const assert3 = (value: unknown): asserts => {}
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json
new file mode 100644
index 000000000000..e368637de0a9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json
@@ -0,0 +1,610 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "assert1"
+ },
+ "name": "assert1"
+ },
+ "init": {
+ "type": "ArrowFunctionExpression",
+ "start": 16,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 32,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypePredicate",
+ "start": 32,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "parameterName": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 51,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 51
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 51,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 51
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ }
+ }
+ },
+ "assertsModifier": true
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 17,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 22,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 24,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 61,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 61
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 64,
+ "end": 117,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 70,
+ "end": 117,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 70,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "assert2"
+ },
+ "name": "assert2"
+ },
+ "init": {
+ "type": "ArrowFunctionExpression",
+ "start": 80,
+ "end": 117,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 96,
+ "end": 111,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 47
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypePredicate",
+ "start": 96,
+ "end": 111,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 47
+ }
+ },
+ "parameterName": {
+ "type": "Identifier",
+ "start": 106,
+ "end": 111,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 47
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "assertsModifier": true
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 81,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 86,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 88,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ }
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 115,
+ "end": 117,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 51
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 118,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 124,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 124,
+ "end": 131,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ },
+ "identifierName": "assert3"
+ },
+ "name": "assert3"
+ },
+ "init": {
+ "type": "ArrowFunctionExpression",
+ "start": 134,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 150,
+ "end": 159,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 152,
+ "end": 159,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 152,
+ "end": 159,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ },
+ "identifierName": "asserts"
+ },
+ "name": "asserts"
+ }
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 135,
+ "end": 149,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 140,
+ "end": 149,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 142,
+ "end": 149,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ }
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 163,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/input.ts
new file mode 100644
index 000000000000..d5ee9a42ce01
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/input.ts
@@ -0,0 +1 @@
+declare function assertIsString(value: unknown): asserts;
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/output.json
new file mode 100644
index 000000000000..dc6f8702bdce
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSDeclareFunction",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "assertIsString"
+ },
+ "name": "assertIsString"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 32,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 39,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ }
+ }
+ }
+ }
+ ],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 47,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 49,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 49
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 49
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ },
+ "identifierName": "asserts"
+ },
+ "name": "asserts"
+ }
+ }
+ },
+ "declare": true
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/input.ts
new file mode 100644
index 000000000000..63613906e9fd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/input.ts
@@ -0,0 +1 @@
+declare function assertIsString(value: unknown): asserts value;
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json
new file mode 100644
index 000000000000..a7b32e23d170
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json
@@ -0,0 +1,167 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSDeclareFunction",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "assertIsString"
+ },
+ "name": "assertIsString"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 32,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 39,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ }
+ }
+ }
+ }
+ ],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 47,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypePredicate",
+ "start": 47,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "parameterName": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 57
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "assertsModifier": true
+ }
+ },
+ "declare": true
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/input.ts
new file mode 100644
index 000000000000..9456a5cb2e50
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/input.ts
@@ -0,0 +1 @@
+declare function assertIsString(value: unknown): asserts value is string;
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json
new file mode 100644
index 000000000000..ca83a725e2d5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 73
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 73
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSDeclareFunction",
+ "start": 0,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 73
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "assertIsString"
+ },
+ "name": "assertIsString"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 32,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 39,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ }
+ }
+ }
+ }
+ ],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 47,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 72
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypePredicate",
+ "start": 47,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 72
+ }
+ },
+ "parameterName": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 57
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 66,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 66
+ },
+ "end": {
+ "line": 1,
+ "column": 72
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 66,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 66
+ },
+ "end": {
+ "line": 1,
+ "column": 72
+ }
+ }
+ }
+ },
+ "assertsModifier": true
+ }
+ },
+ "declare": true
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/input.ts
new file mode 100644
index 000000000000..b04da8349ca2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/input.ts
@@ -0,0 +1,3 @@
+function asserts1 (value: unknown): asserts value is string {}
+function asserts2 (value: unknown): asserts value {}
+function asserts3 (value: unknown): asserts {}
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json
new file mode 100644
index 000000000000..96aea85b2926
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json
@@ -0,0 +1,508 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 163,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 163,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "asserts1"
+ },
+ "name": "asserts1"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 19,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 24,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 26,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ }
+ }
+ }
+ ],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 34,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypePredicate",
+ "start": 34,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "parameterName": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 44
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 53,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 53,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ }
+ }
+ },
+ "assertsModifier": true
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 60,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 60
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 64,
+ "end": 116,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 73,
+ "end": 81,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "asserts2"
+ },
+ "name": "asserts2"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 83,
+ "end": 97,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 88,
+ "end": 97,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 90,
+ "end": 97,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ }
+ }
+ }
+ }
+ ],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 98,
+ "end": 113,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypePredicate",
+ "start": 98,
+ "end": 113,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "parameterName": {
+ "type": "Identifier",
+ "start": 108,
+ "end": 113,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 44
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "assertsModifier": true
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 114,
+ "end": 116,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 50
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 117,
+ "end": 163,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 126,
+ "end": 134,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ },
+ "identifierName": "asserts3"
+ },
+ "name": "asserts3"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 136,
+ "end": 150,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ },
+ "identifierName": "value"
+ },
+ "name": "value",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 141,
+ "end": 150,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnknownKeyword",
+ "start": 143,
+ "end": 150,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ }
+ }
+ }
+ }
+ ],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "start": 151,
+ "end": 160,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 153,
+ "end": 160,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 153,
+ "end": 160,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ },
+ "identifierName": "asserts"
+ },
+ "name": "asserts"
+ }
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 161,
+ "end": 163,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 44
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/function/predicate-types/output.json b/packages/babel-parser/test/fixtures/typescript/function/predicate-types/output.json
index 85ab4987f1c2..90bae5b4ceda 100644
--- a/packages/babel-parser/test/fixtures/typescript/function/predicate-types/output.json
+++ b/packages/babel-parser/test/fixtures/typescript/function/predicate-types/output.json
@@ -127,12 +127,12 @@
},
"typeAnnotation": {
"type": "TSTypePredicate",
- "start": 20,
+ "start": 18,
"end": 32,
"loc": {
"start": {
"line": 1,
- "column": 20
+ "column": 18
},
"end": {
"line": 1,
@@ -302,12 +302,12 @@
},
"typeAnnotation": {
"type": "TSTypePredicate",
- "start": 55,
+ "start": 53,
"end": 67,
"loc": {
"start": {
"line": 2,
- "column": 19
+ "column": 17
},
"end": {
"line": 2,
diff --git a/packages/babel-types/src/definitions/typescript.js b/packages/babel-types/src/definitions/typescript.js
index af34dbfc6255..b20448af8d1e 100644
--- a/packages/babel-types/src/definitions/typescript.js
+++ b/packages/babel-types/src/definitions/typescript.js
@@ -175,10 +175,11 @@ defineType("TSTypeReference", {
defineType("TSTypePredicate", {
aliases: ["TSType"],
- visitor: ["parameterName", "typeAnnotation"],
+ visitor: ["parameterName", "typeAnnotation", "assertsModifier"],
fields: {
parameterName: validateType(["Identifier", "TSThisType"]),
- typeAnnotation: validateType("TSTypeAnnotation"),
+ typeAnnotation: validateOptionalType("TSTypeAnnotation"),
+ assertsModifier: validate(bool),
},
});
From 3a5e8a8dd428bc6240e75ee9aee2ccf2d9443cc6 Mon Sep 17 00:00:00 2001
From: Devon Govett
Date: Tue, 29 Oct 2019 11:37:50 -0700
Subject: [PATCH 017/648] Add support for babel.config.json (#10501)
* Add support for babel.config.json root config
* Throw if multiple configuration files are found
* Add tests
---
.../src/config/files/configuration.js | 36 ++++++++++++---
packages/babel-core/test/config-chain.js | 46 +++++++++++++++++++
.../babel-config-js-and-json/babel.config.js | 3 ++
.../babel.config.json | 3 ++
.../babel-config-js/babel.config.js | 3 ++
.../babel-config-json/babel.config.json | 3 ++
6 files changed, 88 insertions(+), 6 deletions(-)
create mode 100644 packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.js
create mode 100644 packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.json
create mode 100644 packages/babel-core/test/fixtures/config/config-files/babel-config-js/babel.config.js
create mode 100644 packages/babel-core/test/fixtures/config/config-files/babel-config-json/babel.config.json
diff --git a/packages/babel-core/src/config/files/configuration.js b/packages/babel-core/src/config/files/configuration.js
index ab3353f6fde3..adf26e6c687f 100644
--- a/packages/babel-core/src/config/files/configuration.js
+++ b/packages/babel-core/src/config/files/configuration.js
@@ -19,6 +19,11 @@ import type { CallerMetadata } from "../validation/options";
const debug = buildDebug("babel:config:loading:files:configuration");
const BABEL_CONFIG_JS_FILENAME = "babel.config.js";
+const BABEL_CONFIG_JSON_FILENAME = "babel.config.json";
+const ROOT_CONFIG_FILENAMES = [
+ BABEL_CONFIG_JS_FILENAME,
+ BABEL_CONFIG_JSON_FILENAME,
+];
const BABELRC_FILENAME = ".babelrc";
const BABELRC_JS_FILENAME = ".babelrc.js";
@@ -27,7 +32,10 @@ const BABELIGNORE_FILENAME = ".babelignore";
export function findConfigUpwards(rootDir: string): string | null {
let dirname = rootDir;
while (true) {
- if (fs.existsSync(path.join(dirname, BABEL_CONFIG_JS_FILENAME))) {
+ if (
+ fs.existsSync(path.join(dirname, BABEL_CONFIG_JS_FILENAME)) ||
+ fs.existsSync(path.join(dirname, BABEL_CONFIG_JSON_FILENAME))
+ ) {
return dirname;
}
@@ -110,13 +118,29 @@ export function findRootConfig(
envName: string,
caller: CallerMetadata | void,
): ConfigFile | null {
- const filepath = path.resolve(dirname, BABEL_CONFIG_JS_FILENAME);
+ const config = ROOT_CONFIG_FILENAMES.reduce(
+ (previousConfig: ConfigFile | null, name) => {
+ const filepath = path.resolve(dirname, name);
+ const config = readConfig(filepath, envName, caller);
+
+ if (config && previousConfig) {
+ throw new Error(
+ `Multiple configuration files found. Please remove one:\n` +
+ ` - ${path.basename(previousConfig.filepath)}\n` +
+ ` - ${name}\n` +
+ `from ${dirname}`,
+ );
+ }
- const conf = readConfig(filepath, envName, caller);
- if (conf) {
- debug("Found root config %o in %o.", BABEL_CONFIG_JS_FILENAME, dirname);
+ return config || previousConfig;
+ },
+ null,
+ );
+
+ if (config) {
+ debug("Found configuration %o from %o.", config.filepath, dirname);
}
- return conf;
+ return config;
}
export function loadConfig(
diff --git a/packages/babel-core/test/config-chain.js b/packages/babel-core/test/config-chain.js
index 32513b1a4519..c5f6e2ebf205 100644
--- a/packages/babel-core/test/config-chain.js
+++ b/packages/babel-core/test/config-chain.js
@@ -944,6 +944,52 @@ describe("buildConfigChain", function() {
}
});
+ it("should load babel.config.json", () => {
+ const filename = fixture("config-files", "babel-config-json", "src.js");
+
+ expect(
+ loadOptions({
+ filename,
+ cwd: path.dirname(filename),
+ }),
+ ).toEqual({
+ ...getDefaults(),
+ filename: filename,
+ cwd: path.dirname(filename),
+ root: path.dirname(filename),
+ comments: true,
+ });
+ });
+
+ it("should load babel.config.js", () => {
+ const filename = fixture("config-files", "babel-config-js", "src.js");
+
+ expect(
+ loadOptions({
+ filename,
+ cwd: path.dirname(filename),
+ }),
+ ).toEqual({
+ ...getDefaults(),
+ filename: filename,
+ cwd: path.dirname(filename),
+ root: path.dirname(filename),
+ comments: true,
+ });
+ });
+
+ it("should whtow if both babel.config.json and babel.config.js are used", () => {
+ const filename = fixture(
+ "config-files",
+ "babel-config-js-and-json",
+ "src.js",
+ );
+
+ expect(() =>
+ loadOptions({ filename, cwd: path.dirname(filename) }),
+ ).toThrow(/Multiple configuration files found/);
+ });
+
it("should load .babelrc", () => {
const filename = fixture("config-files", "babelrc", "src.js");
diff --git a/packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.js b/packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.js
new file mode 100644
index 000000000000..409f4a98ac90
--- /dev/null
+++ b/packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.js
@@ -0,0 +1,3 @@
+module.exports = {
+ comments: true
+};
diff --git a/packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.json b/packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.json
new file mode 100644
index 000000000000..4b7be6033f68
--- /dev/null
+++ b/packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.json
@@ -0,0 +1,3 @@
+{
+ "comments": true
+}
\ No newline at end of file
diff --git a/packages/babel-core/test/fixtures/config/config-files/babel-config-js/babel.config.js b/packages/babel-core/test/fixtures/config/config-files/babel-config-js/babel.config.js
new file mode 100644
index 000000000000..409f4a98ac90
--- /dev/null
+++ b/packages/babel-core/test/fixtures/config/config-files/babel-config-js/babel.config.js
@@ -0,0 +1,3 @@
+module.exports = {
+ comments: true
+};
diff --git a/packages/babel-core/test/fixtures/config/config-files/babel-config-json/babel.config.json b/packages/babel-core/test/fixtures/config/config-files/babel-config-json/babel.config.json
new file mode 100644
index 000000000000..4b7be6033f68
--- /dev/null
+++ b/packages/babel-core/test/fixtures/config/config-files/babel-config-json/babel.config.json
@@ -0,0 +1,3 @@
+{
+ "comments": true
+}
\ No newline at end of file
From 63f9a3c94688ab6cb917770cf62831a729185c17 Mon Sep 17 00:00:00 2001
From: Georgii Dolzhykov
Date: Tue, 29 Oct 2019 22:25:42 +0200
Subject: [PATCH 018/648] rename `assertsModifier` to `asserts` (#10613)
see https://github.com/babel/babel/pull/10543#issuecomment-547571501
---
.../babel-generator/src/generators/typescript.js | 2 +-
.../babel-parser/src/plugins/typescript/index.js | 12 ++++++------
.../assert-predicate/arrow-function/output.json | 6 +++---
.../assert-predicate/asserts-var/output.json | 4 ++--
.../asserts-with-predicate/output.json | 4 ++--
.../function-declaration/output.json | 6 +++---
packages/babel-types/src/definitions/typescript.js | 4 ++--
7 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/packages/babel-generator/src/generators/typescript.js b/packages/babel-generator/src/generators/typescript.js
index aa5e4ce4cde6..a201a5d5d658 100644
--- a/packages/babel-generator/src/generators/typescript.js
+++ b/packages/babel-generator/src/generators/typescript.js
@@ -197,7 +197,7 @@ export function TSTypeReference(node) {
}
export function TSTypePredicate(node) {
- if (node.assertsModifier) {
+ if (node.asserts) {
this.word("asserts");
this.space();
}
diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js
index a47dfac29ba6..26a6246d59e6 100644
--- a/packages/babel-parser/src/plugins/typescript/index.js
+++ b/packages/babel-parser/src/plugins/typescript/index.js
@@ -904,8 +904,8 @@ export default (superClass: Class): Class =>
const t: N.TsTypeAnnotation = this.startNode();
this.expect(returnToken);
- const assertsModifier = this.tsTryParse(
- this.tsParseTypePredicateAssertsModifier.bind(this),
+ const asserts = this.tsTryParse(
+ this.tsParseTypePredicateAsserts.bind(this),
);
const typePredicateVariable =
@@ -913,7 +913,7 @@ export default (superClass: Class): Class =>
this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
if (!typePredicateVariable) {
- if (!assertsModifier) {
+ if (!asserts) {
// : type
return this.tsParseTypeAnnotation(/* eatColon */ false, t);
}
@@ -921,7 +921,7 @@ export default (superClass: Class): Class =>
// : asserts foo
const node = this.startNodeAtNode(t);
node.parameterName = this.parseIdentifier();
- node.assertsModifier = assertsModifier;
+ node.asserts = asserts;
t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
return this.finishNode(t, "TSTypeAnnotation");
}
@@ -931,7 +931,7 @@ export default (superClass: Class): Class =>
const node = this.startNodeAtNode(t);
node.parameterName = typePredicateVariable;
node.typeAnnotation = type;
- node.assertsModifier = assertsModifier;
+ node.asserts = asserts;
t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
return this.finishNode(t, "TSTypeAnnotation");
});
@@ -959,7 +959,7 @@ export default (superClass: Class): Class =>
}
}
- tsParseTypePredicateAssertsModifier(): boolean {
+ tsParseTypePredicateAsserts(): boolean {
if (!this.tsIsIdentifier()) {
return false;
}
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json
index e368637de0a9..f06258409292 100644
--- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json
@@ -164,7 +164,7 @@
}
}
},
- "assertsModifier": true
+ "asserts": true
}
},
"id": null,
@@ -346,7 +346,7 @@
},
"name": "value"
},
- "assertsModifier": true
+ "asserts": true
}
},
"id": null,
@@ -607,4 +607,4 @@
],
"directives": []
}
-}
\ No newline at end of file
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json
index a7b32e23d170..62c634c7dc8e 100644
--- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json
@@ -156,7 +156,7 @@
},
"name": "value"
},
- "assertsModifier": true
+ "asserts": true
}
},
"declare": true
@@ -164,4 +164,4 @@
],
"directives": []
}
-}
\ No newline at end of file
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json
index ca83a725e2d5..82cdaebbcf79 100644
--- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json
@@ -186,7 +186,7 @@
}
}
},
- "assertsModifier": true
+ "asserts": true
}
},
"declare": true
@@ -194,4 +194,4 @@
],
"directives": []
}
-}
\ No newline at end of file
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json
index 96aea85b2926..bea1caf3de2a 100644
--- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json
+++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json
@@ -186,7 +186,7 @@
}
}
},
- "assertsModifier": true
+ "asserts": true
}
},
"body": {
@@ -334,7 +334,7 @@
},
"name": "value"
},
- "assertsModifier": true
+ "asserts": true
}
},
"body": {
@@ -505,4 +505,4 @@
],
"directives": []
}
-}
\ No newline at end of file
+}
diff --git a/packages/babel-types/src/definitions/typescript.js b/packages/babel-types/src/definitions/typescript.js
index b20448af8d1e..bba8a5b73c8e 100644
--- a/packages/babel-types/src/definitions/typescript.js
+++ b/packages/babel-types/src/definitions/typescript.js
@@ -175,11 +175,11 @@ defineType("TSTypeReference", {
defineType("TSTypePredicate", {
aliases: ["TSType"],
- visitor: ["parameterName", "typeAnnotation", "assertsModifier"],
+ visitor: ["parameterName", "typeAnnotation", "asserts"],
fields: {
parameterName: validateType(["Identifier", "TSThisType"]),
typeAnnotation: validateOptionalType("TSTypeAnnotation"),
- assertsModifier: validate(bool),
+ asserts: validate(bool),
},
});
From 143d159982bcbe9a31c758b67a888d948c5ff376 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Tue, 29 Oct 2019 22:18:39 +0100
Subject: [PATCH 019/648] Create parser plugin "topLevelAwait" (#10449)
* Create parser plugin "topLevelAwait"
* Update test262 whitelist
* Update ts typings
* Fix "sourceType: unambiguous" with TLA
* Ambiguous tokens after await
* Update await %x(0)
* typo [skip ci]
* Typo [skip ci]
Co-Authored-By: Brian Ng
---
packages/babel-parser/src/index.js | 25 +-
packages/babel-parser/src/parser/base.js | 1 +
.../babel-parser/src/parser/expression.js | 25 +
packages/babel-parser/src/parser/statement.js | 6 +-
.../top-level-await/export-default/input.js | 1 +
.../export-default/options.json | 4 +
.../export-default/output.json | 85 ++++
.../top-level-await/for-await-module/input.js | 1 +
.../for-await-module/options.json | 4 +
.../for-await-module/output.json | 134 +++++
.../top-level-await/for-await-script/input.js | 1 +
.../for-await-script/options.json | 5 +
.../top-level-await/inside-arrow/input.js | 1 +
.../top-level-await/inside-arrow/options.json | 5 +
.../top-level-await/inside-block/input.js | 3 +
.../top-level-await/inside-block/options.json | 4 +
.../top-level-await/inside-block/output.json | 135 +++++
.../top-level-await/inside-function/input.js | 3 +
.../inside-function/options.json | 5 +
.../top-level-await/top-level-module/input.js | 1 +
.../top-level-module/options.json | 4 +
.../top-level-module/output.json | 85 ++++
.../top-level-await/top-level-script/input.js | 1 +
.../top-level-script/options.json | 5 +
.../input.js | 7 +
.../options.json | 5 +
.../output.json | 388 ++++++++++++++
.../unambiguous-ambiguous-modulo/input.js | 1 +
.../unambiguous-ambiguous-modulo/options.json | 4 +
.../unambiguous-ambiguous-modulo/output.json | 137 +++++
.../unambiguous-ambiguous-script/input.js | 8 +
.../unambiguous-ambiguous-script/options.json | 4 +
.../unambiguous-ambiguous-script/output.json | 476 ++++++++++++++++++
.../input.js | 1 +
.../options.json | 4 +
.../output.json | 137 +++++
.../unambiguous-module/input.js | 7 +
.../unambiguous-module/options.json | 4 +
.../unambiguous-module/output.json | 388 ++++++++++++++
.../babel-parser/typings/babel-parser.d.ts | 1 +
.../test262/run_babel_parser_test262_utils.js | 1 +
scripts/tests/test262/test262_whitelist.txt | 452 -----------------
42 files changed, 2108 insertions(+), 461 deletions(-)
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-script/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-script/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/input.js
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/output.json
diff --git a/packages/babel-parser/src/index.js b/packages/babel-parser/src/index.js
index d9f812695545..3e9696b858fc 100755
--- a/packages/babel-parser/src/index.js
+++ b/packages/babel-parser/src/index.js
@@ -25,15 +25,32 @@ export function parse(input: string, options?: Options): File {
const parser = getParser(options, input);
const ast = parser.parse();
- // Rather than try to parse as a script first, we opt to parse as a module and convert back
- // to a script where possible to avoid having to do a full re-parse of the input content.
- if (!parser.sawUnambiguousESM) ast.program.sourceType = "script";
+ if (parser.sawUnambiguousESM) {
+ return ast;
+ }
+
+ if (parser.ambiguousScriptDifferentAst) {
+ // Top level await introduces code which can be both a valid script and
+ // a valid module, but which produces different ASTs:
+ // await
+ // 0
+ // can be parsed either as an AwaitExpression, or as two ExpressionStatements.
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch {}
+ } else {
+ // This is both a valid module and a valid script, but
+ // we parse it as a script by default
+ ast.program.sourceType = "script";
+ }
+
return ast;
} catch (moduleError) {
try {
options.sourceType = "script";
return getParser(options, input).parse();
- } catch (scriptError) {}
+ } catch {}
throw moduleError;
}
diff --git a/packages/babel-parser/src/parser/base.js b/packages/babel-parser/src/parser/base.js
index 1e451794158c..f4fb9f3b66e0 100644
--- a/packages/babel-parser/src/parser/base.js
+++ b/packages/babel-parser/src/parser/base.js
@@ -13,6 +13,7 @@ export default class BaseParser {
plugins: PluginsMap;
filename: ?string;
sawUnambiguousESM: boolean = false;
+ ambiguousScriptDifferentAst: boolean = false;
// Initialized by Tokenizer
state: State;
diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js
index 556ac6daa7be..04299e439830 100644
--- a/packages/babel-parser/src/parser/expression.js
+++ b/packages/babel-parser/src/parser/expression.js
@@ -2208,6 +2208,7 @@ export default class ExpressionParser extends LValParser {
isAwaitAllowed(): boolean {
if (this.scope.inFunction) return this.scope.inAsync;
if (this.options.allowAwaitOutsideFunction) return true;
+ if (this.hasPlugin("topLevelAwait")) return this.inModule;
return false;
}
@@ -2234,9 +2235,33 @@ export default class ExpressionParser extends LValParser {
);
}
+ if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
+ if (
+ this.hasPrecedingLineBreak() ||
+ // All the following expressions are ambiguous:
+ // await + 0, await - 0, await ( 0 ), await [ 0 ], await / 0 /u, await ``
+ this.match(tt.plusMin) ||
+ this.match(tt.parenL) ||
+ this.match(tt.bracketL) ||
+ this.match(tt.backQuote) ||
+ // Sometimes the tokenizer generates tt.slash for regexps, and this is
+ // handler by parseExprAtom
+ this.match(tt.regexp) ||
+ this.match(tt.slash) ||
+ // This code could be parsed both as a modulo operator or as an intrinsic:
+ // await %x(0)
+ (this.hasPlugin("v8intrinsic") && this.match(tt.modulo))
+ ) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
if (!this.state.soloAwait) {
node.argument = this.parseMaybeUnary();
}
+
return this.finishNode(node, "AwaitExpression");
}
diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js
index 6a67349b2820..9d87c3d27ed2 100644
--- a/packages/babel-parser/src/parser/statement.js
+++ b/packages/babel-parser/src/parser/statement.js
@@ -495,11 +495,7 @@ export default class StatementParser extends ExpressionParser {
this.state.labels.push(loopLabel);
let awaitAt = -1;
- if (
- (this.scope.inAsync ||
- (!this.scope.inFunction && this.options.allowAwaitOutsideFunction)) &&
- this.eatContextual("await")
- ) {
+ if (this.isAwaitAllowed() && this.eatContextual("await")) {
awaitAt = this.state.lastTokStart;
}
this.scope.enter(SCOPE_OTHER);
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/input.js
new file mode 100644
index 000000000000..fd1dbe08b03f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/input.js
@@ -0,0 +1 @@
+export default await 0;
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/options.json
new file mode 100644
index 000000000000..4d7a9975be5a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/output.json
new file mode 100644
index 000000000000..81e260bd12b2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/output.json
@@ -0,0 +1,85 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "declaration": {
+ "type": "AwaitExpression",
+ "start": 15,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/input.js
new file mode 100644
index 000000000000..ac76014a6f83
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/input.js
@@ -0,0 +1 @@
+for await (const a of b);
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/options.json
new file mode 100644
index 000000000000..aadc3411ae9b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "module"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/output.json
new file mode 100644
index 000000000000..42be5c156ae8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "await": true,
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 11,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": null
+ }
+ ],
+ "kind": "const"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-script/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-script/input.js
new file mode 100644
index 000000000000..ac76014a6f83
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-script/input.js
@@ -0,0 +1 @@
+for await (const a of b);
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-script/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-script/options.json
new file mode 100644
index 000000000000..ad8783d13faa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-script/options.json
@@ -0,0 +1,5 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "script",
+ "throws": "Unexpected token, expected \"(\" (1:4)"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/input.js
new file mode 100644
index 000000000000..bde15d37c8ca
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/input.js
@@ -0,0 +1 @@
+() => await 0;
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json
new file mode 100644
index 000000000000..95eb740f8dfb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json
@@ -0,0 +1,5 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "module",
+ "throws": "Can not use keyword 'await' outside an async function (1:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/input.js
new file mode 100644
index 000000000000..f264b0344b3b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/input.js
@@ -0,0 +1,3 @@
+if (true) {
+ await 0;
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/options.json
new file mode 100644
index 000000000000..aadc3411ae9b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "module"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/output.json
new file mode 100644
index 000000000000..b70dffe352c1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/output.json
@@ -0,0 +1,135 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "IfStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 4,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": true
+ },
+ "consequent": {
+ "type": "BlockStatement",
+ "start": 10,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 14,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ },
+ "alternate": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/input.js
new file mode 100644
index 000000000000..ced447b77235
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/input.js
@@ -0,0 +1,3 @@
+function fn() {
+ await 0;
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json
new file mode 100644
index 000000000000..d09f3f654766
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json
@@ -0,0 +1,5 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "module",
+ "throws": "Can not use keyword 'await' outside an async function (2:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/input.js
new file mode 100644
index 000000000000..d8ddd6c0ad0b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/input.js
@@ -0,0 +1 @@
+await 0;
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/options.json
new file mode 100644
index 000000000000..aadc3411ae9b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "module"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/output.json
new file mode 100644
index 000000000000..02ef8ffabf64
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/output.json
@@ -0,0 +1,85 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/input.js
new file mode 100644
index 000000000000..d8ddd6c0ad0b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/input.js
@@ -0,0 +1 @@
+await 0;
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/options.json
new file mode 100644
index 000000000000..c9dc6113fea3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/options.json
@@ -0,0 +1,5 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "script",
+ "throws": "Unexpected token, expected \";\" (1:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/input.js
new file mode 100644
index 000000000000..1fa05e429c67
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/input.js
@@ -0,0 +1,7 @@
+await 0
+
+await + 0
+await - 0
+await ( 0 )
+await [ 0 ]
+await / 0 /u
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/options.json
new file mode 100644
index 000000000000..aceca10c3d74
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/options.json
@@ -0,0 +1,5 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "unambiguous",
+ "allowAwaitOutsideFunction": true
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/output.json
new file mode 100644
index 000000000000..76e30779fc90
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/output.json
@@ -0,0 +1,388 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "argument": {
+ "type": "UnaryExpression",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "operator": "+",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "argument": {
+ "type": "UnaryExpression",
+ "start": 25,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "operator": "-",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 29,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0",
+ "parenthesized": true,
+ "parenStart": 35
+ },
+ "value": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 41,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 41,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "argument": {
+ "type": "ArrayExpression",
+ "start": 47,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 49,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 53,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 53,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "argument": {
+ "type": "RegExpLiteral",
+ "start": 59,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 6
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "extra": {
+ "raw": "/ 0 /u"
+ },
+ "pattern": " 0 ",
+ "flags": "u"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/input.js
new file mode 100644
index 000000000000..735a0162b362
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/input.js
@@ -0,0 +1 @@
+await %x(0)
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/options.json
new file mode 100644
index 000000000000..2503b82adf74
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "unambiguous"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/output.json
new file mode 100644
index 000000000000..5805e3195560
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "operator": "%",
+ "right": {
+ "type": "CallExpression",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "arguments": [
+ {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/input.js
new file mode 100644
index 000000000000..9fac4af0f0aa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/input.js
@@ -0,0 +1,8 @@
+await
+0
+
+await + 0
+await - 0
+await ( 0 )
+await [ 0 ]
+await / 0 /u
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/options.json
new file mode 100644
index 000000000000..2503b82adf74
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "unambiguous"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/output.json
new file mode 100644
index 000000000000..76a211cbb464
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/output.json
@@ -0,0 +1,476 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "operator": "-",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 29,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "arguments": [
+ {
+ "type": "NumericLiteral",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 41,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 41,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "property": {
+ "type": "NumericLiteral",
+ "start": 49,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ "computed": true
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 53,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 53,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "left": {
+ "type": "BinaryExpression",
+ "start": 53,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 53,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "operator": "/",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ },
+ "operator": "/",
+ "right": {
+ "type": "Identifier",
+ "start": 64,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ },
+ "identifierName": "u"
+ },
+ "name": "u"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/input.js
new file mode 100644
index 000000000000..735a0162b362
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/input.js
@@ -0,0 +1 @@
+await %x(0)
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/options.json
new file mode 100644
index 000000000000..6732f5f2f093
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["topLevelAwait", "v8intrinsic"],
+ "sourceType": "unambiguous"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/output.json
new file mode 100644
index 000000000000..5805e3195560
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "operator": "%",
+ "right": {
+ "type": "CallExpression",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "arguments": [
+ {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/input.js
new file mode 100644
index 000000000000..1fa05e429c67
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/input.js
@@ -0,0 +1,7 @@
+await 0
+
+await + 0
+await - 0
+await ( 0 )
+await [ 0 ]
+await / 0 /u
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/options.json
new file mode 100644
index 000000000000..2503b82adf74
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["topLevelAwait"],
+ "sourceType": "unambiguous"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/output.json
new file mode 100644
index 000000000000..18617474f20a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/output.json
@@ -0,0 +1,388 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "argument": {
+ "type": "UnaryExpression",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "operator": "+",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "argument": {
+ "type": "UnaryExpression",
+ "start": 25,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "operator": "-",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 29,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0",
+ "parenthesized": true,
+ "parenStart": 35
+ },
+ "value": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 41,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 41,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "argument": {
+ "type": "ArrayExpression",
+ "start": 47,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 49,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 53,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 53,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "argument": {
+ "type": "RegExpLiteral",
+ "start": 59,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 6
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "extra": {
+ "raw": "/ 0 /u"
+ },
+ "pattern": " 0 ",
+ "flags": "u"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts
index 575843e6d24b..40161080996b 100644
--- a/packages/babel-parser/typings/babel-parser.d.ts
+++ b/packages/babel-parser/typings/babel-parser.d.ts
@@ -123,6 +123,7 @@ export type ParserPlugin =
'pipelineOperator' |
'placeholders' |
'throwExpressions' |
+ 'topLevelAwait' |
'typescript' |
'v8intrinsic' |
ParserPluginWithOptions;
diff --git a/scripts/tests/test262/run_babel_parser_test262_utils.js b/scripts/tests/test262/run_babel_parser_test262_utils.js
index 1434eedfd629..2c35d0ed5933 100644
--- a/scripts/tests/test262/run_babel_parser_test262_utils.js
+++ b/scripts/tests/test262/run_babel_parser_test262_utils.js
@@ -123,6 +123,7 @@ const featuresToPlugins = {
"import.meta": "importMeta",
"numeric-separator-literal": "numericSeparator",
"optional-chaining": "optionalChaining",
+ "top-level-await": "topLevelAwait",
};
function getPlugins(features) {
diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt
index 8ed606443333..1e21dcd228dc 100644
--- a/scripts/tests/test262/test262_whitelist.txt
+++ b/scripts/tests/test262/test262_whitelist.txt
@@ -98,458 +98,6 @@ language/module-code/privatename-not-valid-earlyerr-module-3.js(default)
language/module-code/privatename-not-valid-earlyerr-module-3.js(strict mode)
language/module-code/privatename-not-valid-earlyerr-module-4.js(default)
language/module-code/privatename-not-valid-earlyerr-module-4.js(strict mode)
-language/module-code/top-level-await/await-awaits-thenable-not-callable.js(default)
-language/module-code/top-level-await/await-awaits-thenable-not-callable.js(strict mode)
-language/module-code/top-level-await/await-awaits-thenables-that-throw.js(default)
-language/module-code/top-level-await/await-awaits-thenables-that-throw.js(strict mode)
-language/module-code/top-level-await/await-awaits-thenables.js(default)
-language/module-code/top-level-await/await-awaits-thenables.js(strict mode)
-language/module-code/top-level-await/await-dynamic-import-rejection.js(default)
-language/module-code/top-level-await/await-dynamic-import-rejection.js(strict mode)
-language/module-code/top-level-await/await-dynamic-import-resolution.js(default)
-language/module-code/top-level-await/await-dynamic-import-resolution.js(strict mode)
-language/module-code/top-level-await/await-expr-func-expression.js(default)
-language/module-code/top-level-await/await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/await-expr-new-expr-reject.js(default)
-language/module-code/top-level-await/await-expr-new-expr-reject.js(strict mode)
-language/module-code/top-level-await/await-expr-new-expr.js(default)
-language/module-code/top-level-await/await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/await-expr-regexp.js(default)
-language/module-code/top-level-await/await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/await-expr-reject-throws.js(default)
-language/module-code/top-level-await/await-expr-reject-throws.js(strict mode)
-language/module-code/top-level-await/await-expr-resolution.js(default)
-language/module-code/top-level-await/await-expr-resolution.js(strict mode)
-language/module-code/top-level-await/await-void-expr.js(default)
-language/module-code/top-level-await/await-void-expr.js(strict mode)
-language/module-code/top-level-await/if-await-expr.js(default)
-language/module-code/top-level-await/if-await-expr.js(strict mode)
-language/module-code/top-level-await/module-async-import-async-resolution-ticks.js(default)
-language/module-code/top-level-await/module-async-import-async-resolution-ticks.js(strict mode)
-language/module-code/top-level-await/module-import-unwrapped.js(default)
-language/module-code/top-level-await/module-import-unwrapped.js(strict mode)
-language/module-code/top-level-await/module-self-import-async-resolution-ticks.js(default)
-language/module-code/top-level-await/module-self-import-async-resolution-ticks.js(strict mode)
-language/module-code/top-level-await/syntax/await-expr-dyn-import.js(default)
-language/module-code/top-level-await/syntax/await-expr-dyn-import.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/block-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/block-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/catch-parameter.js(default)
-language/module-code/top-level-await/syntax/catch-parameter.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/export-class-decl-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/export-lex-decl-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/export-var-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/export-var-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/for-await-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/for-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-in-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/for-in-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/for-of-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/for-of-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/if-block-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/if-block-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/if-expr-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/if-expr-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/top-level-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/top-level-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/try-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/try-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/typeof-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/typeof-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/void-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/void-await-expr-this.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-array-literal.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-array-literal.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-func-expression.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-func-expression.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-identifier.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-identifier.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-literal-number.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-literal-number.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-literal-string.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-literal-string.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-nested.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-nested.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-new-expr.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-new-expr.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-null.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-null.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-obj-literal.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-obj-literal.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-regexp.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-regexp.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-template-literal.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-template-literal.js(strict mode)
-language/module-code/top-level-await/syntax/while-await-expr-this.js(default)
-language/module-code/top-level-await/syntax/while-await-expr-this.js(strict mode)
-language/module-code/top-level-await/top-level-ticks-2.js(default)
-language/module-code/top-level-await/top-level-ticks-2.js(strict mode)
-language/module-code/top-level-await/top-level-ticks.js(default)
-language/module-code/top-level-await/top-level-ticks.js(strict mode)
-language/module-code/top-level-await/void-await-expr.js(default)
-language/module-code/top-level-await/void-await-expr.js(strict mode)
-language/module-code/top-level-await/while-dynamic-evaluation.js(default)
-language/module-code/top-level-await/while-dynamic-evaluation.js(strict mode)
language/statements/class/elements/fields-duplicate-privatenames.js(default)
language/statements/class/elements/fields-duplicate-privatenames.js(strict mode)
language/statements/class/elements/privatename-not-valid-earlyerr-script-1.js(default)
From 198b4a0fbd809c218603d3c54d122c769b2b18ff Mon Sep 17 00:00:00 2001
From: Micah Zoltu
Date: Wed, 30 Oct 2019 05:19:49 +0800
Subject: [PATCH 020/648] =?UTF-8?q?Changes=20UMD=20callsite=20to=20be=20mo?=
=?UTF-8?q?re=20likely=20to=20pass=20in=20the=20intended=E2=80=A6=20(#1047?=
=?UTF-8?q?7)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Changes UMD callsite to be more likely to pass in the intended object.
Fixes #10476
Note: This PR should be considered pseudocode and used as an illustration of the proposed fix. I do not know nearly enough about this project to know if this is an appropriate solution to the problem, nor do I have the confidence to update the tests appropriately.
* Update tests
---
.../export-default-arrow-renaming-module-umd/output.js | 2 +-
packages/babel-plugin-transform-modules-umd/src/index.js | 6 +++++-
.../test/fixtures/loose/export-default-10/output.js | 2 +-
.../test/fixtures/loose/export-default-11/output.js | 2 +-
.../test/fixtures/loose/export-default-2/output.js | 2 +-
.../test/fixtures/loose/export-default-3/output.js | 2 +-
.../test/fixtures/loose/export-default-4/output.js | 2 +-
.../test/fixtures/loose/export-default-5/output.js | 2 +-
.../test/fixtures/loose/export-default-6/output.js | 2 +-
.../test/fixtures/loose/export-default-7/output.js | 2 +-
.../test/fixtures/loose/export-default-8/output.js | 2 +-
.../test/fixtures/loose/export-default-9/output.js | 2 +-
.../test/fixtures/loose/export-default/output.js | 2 +-
.../test/fixtures/loose/export-from-2/output.js | 2 +-
.../test/fixtures/loose/export-from-3/output.js | 2 +-
.../test/fixtures/loose/export-from-4/output.js | 2 +-
.../test/fixtures/loose/export-from-5/output.js | 2 +-
.../test/fixtures/loose/export-from-6/output.js | 2 +-
.../test/fixtures/loose/export-from/output.js | 2 +-
.../test/fixtures/loose/export-named-2/output.js | 2 +-
.../test/fixtures/loose/export-named-3/output.js | 2 +-
.../test/fixtures/loose/export-named-4/output.js | 2 +-
.../test/fixtures/loose/export-named-5/output.js | 2 +-
.../test/fixtures/loose/export-named/output.js | 2 +-
.../test/fixtures/loose/exports-variable/output.js | 2 +-
.../test/fixtures/loose/get-module-name-option/output.js | 2 +-
.../test/fixtures/loose/hoist-function-exports/output.js | 2 +-
.../test/fixtures/loose/imports-default/output.js | 2 +-
.../imports-exact-globals-false-with-overrides/output.js | 2 +-
.../fixtures/loose/imports-exact-globals-false/output.js | 2 +-
.../imports-exact-globals-true-with-overrides/output.js | 2 +-
.../fixtures/loose/imports-exact-globals-true/output.js | 2 +-
.../test/fixtures/loose/imports-glob/output.js | 2 +-
.../test/fixtures/loose/imports-mixing/output.js | 2 +-
.../test/fixtures/loose/imports-named/output.js | 2 +-
.../test/fixtures/loose/imports/output.js | 2 +-
.../module-id-with-overridden-global-in-namespace/output.js | 2 +-
.../output.js | 2 +-
.../loose/module-id-with-overridden-global/output.js | 2 +-
.../test/fixtures/loose/module-id/output.js | 2 +-
.../loose/module-name-with-overridden-global/output.js | 2 +-
.../test/fixtures/loose/module-name/output.js | 2 +-
.../test/fixtures/loose/non-default-imports/output.js | 2 +-
.../test/fixtures/loose/override-export-name/output.js | 2 +-
.../test/fixtures/loose/override-import-name/output.js | 2 +-
.../test/fixtures/loose/overview/output.js | 2 +-
.../test/fixtures/loose/remap/output.js | 2 +-
.../test/fixtures/regression/4192/output.js | 2 +-
.../test/fixtures/umd/export-default-10/output.js | 2 +-
.../test/fixtures/umd/export-default-11/output.js | 2 +-
.../test/fixtures/umd/export-default-2/output.js | 2 +-
.../test/fixtures/umd/export-default-3/output.js | 2 +-
.../test/fixtures/umd/export-default-4/output.js | 2 +-
.../test/fixtures/umd/export-default-5/output.js | 2 +-
.../test/fixtures/umd/export-default-6/output.js | 2 +-
.../test/fixtures/umd/export-default-7/output.js | 2 +-
.../test/fixtures/umd/export-default-8/output.js | 2 +-
.../test/fixtures/umd/export-default-9/output.js | 2 +-
.../test/fixtures/umd/export-default/output.js | 2 +-
.../test/fixtures/umd/export-from-2/output.js | 2 +-
.../test/fixtures/umd/export-from-3/output.js | 2 +-
.../test/fixtures/umd/export-from-4/output.js | 2 +-
.../test/fixtures/umd/export-from-5/output.js | 2 +-
.../test/fixtures/umd/export-from-6/output.js | 2 +-
.../test/fixtures/umd/export-from/output.js | 2 +-
.../test/fixtures/umd/export-named-2/output.js | 2 +-
.../test/fixtures/umd/export-named-3/output.js | 2 +-
.../test/fixtures/umd/export-named-4/output.js | 2 +-
.../test/fixtures/umd/export-named-5/output.js | 2 +-
.../test/fixtures/umd/export-named/output.js | 2 +-
.../test/fixtures/umd/exports-variable/output.js | 2 +-
.../test/fixtures/umd/get-module-name-option/output.js | 2 +-
.../test/fixtures/umd/hoist-function-exports/output.js | 2 +-
.../test/fixtures/umd/imports-default/output.js | 2 +-
.../imports-exact-globals-false-with-overrides/output.js | 2 +-
.../test/fixtures/umd/imports-exact-globals-false/output.js | 2 +-
.../umd/imports-exact-globals-true-with-overrides/output.js | 2 +-
.../test/fixtures/umd/imports-exact-globals-true/output.js | 2 +-
.../test/fixtures/umd/imports-glob/output.js | 2 +-
.../test/fixtures/umd/imports-mixing/output.js | 2 +-
.../test/fixtures/umd/imports-named/output.js | 2 +-
.../test/fixtures/umd/imports/output.js | 2 +-
.../module-id-with-overridden-global-in-namespace/output.js | 2 +-
.../output.js | 2 +-
.../fixtures/umd/module-id-with-overridden-global/output.js | 2 +-
.../test/fixtures/umd/module-id/output.js | 2 +-
.../umd/module-name-with-overridden-global/output.js | 2 +-
.../test/fixtures/umd/module-name/output.js | 2 +-
.../test/fixtures/umd/non-default-imports/output.js | 2 +-
.../test/fixtures/umd/override-export-name/output.js | 2 +-
.../test/fixtures/umd/override-import-name/output.js | 2 +-
.../test/fixtures/umd/overview/output.js | 2 +-
.../test/fixtures/umd/remap/output.js | 2 +-
.../test/fixtures/dynamic-import/modules-umd/output.js | 4 +++-
.../test/fixtures/modules/modules-umd/output.js | 4 +++-
95 files changed, 103 insertions(+), 95 deletions(-)
diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-umd/output.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-umd/output.js
index 318c2544cd52..aca80143342e 100644
--- a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-umd/output.js
+++ b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-umd/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/src/index.js b/packages/babel-plugin-transform-modules-umd/src/index.js
index cd8000febb85..037c70f2b45b 100644
--- a/packages/babel-plugin-transform-modules-umd/src/index.js
+++ b/packages/babel-plugin-transform-modules-umd/src/index.js
@@ -27,7 +27,11 @@ const buildWrapper = template(`
GLOBAL_TO_ASSIGN;
}
- })(this, function(IMPORT_NAMES) {
+ })(
+ typeof globalThis === "object" ? globalThis
+ : typeof self === "object" ? self
+ : this,
+ function(IMPORT_NAMES) {
})
`);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-10/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-10/output.js
index f8e0cb66efbf..32501cb4319b 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-10/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-10/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-11/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-11/output.js
index 44e4e41f1697..0633fe90d0a0 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-11/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-11/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-2/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-2/output.js
index 690c27a48c25..34e8e2fa3d82 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-2/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-2/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-3/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-3/output.js
index 956a4b228e56..aa3b89c8d714 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-3/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-3/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-4/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-4/output.js
index dcc999f2fb2b..7e144092f4e7 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-4/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-4/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-5/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-5/output.js
index 255345ddc41e..6766df086135 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-5/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-5/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-6/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-6/output.js
index c10daf42709d..4fd6be58e8d3 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-6/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-6/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-7/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-7/output.js
index 7cfc99ccd16c..fa009a30d6df 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-7/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-7/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-8/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-8/output.js
index 605b6c2762f8..f221e56a8ccd 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-8/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-8/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-9/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-9/output.js
index 493509da29c4..f840c25e6f78 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-9/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-9/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default/output.js
index 406ad75ef7dc..5b666da90d2f 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-2/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-2/output.js
index b03b7b38d0f8..14961ba262e8 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-2/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-2/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-3/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-3/output.js
index 99cc2cff28f4..fb7da87c3f20 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-3/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-3/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-4/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-4/output.js
index 36925b451778..dc7a24f5f4c5 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-4/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-4/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-5/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-5/output.js
index eaa85ea93a42..2e900d34ed1a 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-5/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-5/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-6/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-6/output.js
index b7d54d8219b9..feaf9c4c81a1 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-6/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-6/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from/output.js
index cde17ba82168..c9634daa1bc9 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-2/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-2/output.js
index 493509da29c4..f840c25e6f78 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-2/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-2/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-3/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-3/output.js
index c0e16dfcdfd3..d8434b638462 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-3/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-3/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-4/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-4/output.js
index b612eb59ae64..9f6a74975f35 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-4/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-4/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-5/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-5/output.js
index 37b7013b6631..60d36f6a310e 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-5/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-5/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named/output.js
index e1e04041f87f..e12b16c662f8 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/exports-variable/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/exports-variable/output.js
index 5606fe898c1a..34f0969295f0 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/exports-variable/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/exports-variable/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/get-module-name-option/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/get-module-name-option/output.js
index d5c94066201a..9ef9726b81db 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/get-module-name-option/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/get-module-name-option/output.js
@@ -10,6 +10,6 @@
factory();
global.myCustomModuleName = mod.exports;
}
-})(this, function () {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () {
"use strict";
});
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/hoist-function-exports/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/hoist-function-exports/output.js
index 87e3e0226890..3894e1d6357b 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/hoist-function-exports/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/hoist-function-exports/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.evens);
global.input = mod.exports;
}
-})(this, function (_exports, _evens) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _evens) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-default/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-default/output.js
index bdc895976fd3..733966a5af62 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-default/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-default/output.js
@@ -10,7 +10,7 @@
factory(global.foo);
global.input = mod.exports;
}
-})(this, function (_foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) {
"use strict";
_foo = babelHelpers.interopRequireDefault(_foo);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false-with-overrides/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false-with-overrides/output.js
index 79531c289ced..9d38e1ce05a6 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false-with-overrides/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false-with-overrides/output.js
@@ -10,7 +10,7 @@
factory(global.fooBAR, global.fooBAR, global.fizzBuzz);
global.input = mod.exports;
}
-})(this, function (_fooBar, _fooBar2, _fizzbuzz) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) {
"use strict";
_fooBar = babelHelpers.interopRequireDefault(_fooBar);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false/output.js
index 72d8bf864d29..18307048ec1b 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false/output.js
@@ -10,7 +10,7 @@
factory(global.fooBar, global.fooBar, global.fizzbuzz);
global.input = mod.exports;
}
-})(this, function (_fooBar, _fooBar2, _fizzbuzz) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) {
"use strict";
_fooBar = babelHelpers.interopRequireDefault(_fooBar);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true-with-overrides/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true-with-overrides/output.js
index bd083836e425..05b85cc76366 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true-with-overrides/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true-with-overrides/output.js
@@ -10,7 +10,7 @@
factory(global.fooBAR, global.mylib.fooBar, global.fizz.buzz);
global.input = mod.exports;
}
-})(this, function (_fooBar, _fooBar2, _fizzbuzz) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) {
"use strict";
_fooBar = babelHelpers.interopRequireDefault(_fooBar);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true/output.js
index c16c74d6d69c..baea395d1471 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true/output.js
@@ -10,7 +10,7 @@
factory(global.fooBar, global.mylibFooBar, global.fizzbuzz);
global.input = mod.exports;
}
-})(this, function (_fooBar, _fooBar2, _fizzbuzz) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) {
"use strict";
_fooBar = babelHelpers.interopRequireDefault(_fooBar);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-glob/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-glob/output.js
index 3f403ba8ad4a..2820bf461f2a 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-glob/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-glob/output.js
@@ -10,7 +10,7 @@
factory(global.foo);
global.input = mod.exports;
}
-})(this, function (foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (foo) {
"use strict";
foo = babelHelpers.interopRequireWildcard(foo);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-mixing/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-mixing/output.js
index f51c2d99aefa..37b9f152bef7 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-mixing/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-mixing/output.js
@@ -10,7 +10,7 @@
factory(global.foo);
global.input = mod.exports;
}
-})(this, function (_foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) {
"use strict";
_foo = babelHelpers.interopRequireWildcard(_foo);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-named/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-named/output.js
index d0629b1666d4..f8fb2a0217cb 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-named/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-named/output.js
@@ -10,7 +10,7 @@
factory(global.foo);
global.input = mod.exports;
}
-})(this, function (_foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) {
"use strict";
_foo.bar;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports/output.js
index c625f2ad0f13..0e773a28c17e 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports/output.js
@@ -10,6 +10,6 @@
factory(global.foo, global.fooBar, global.fooBar);
global.input = mod.exports;
}
-})(this, function (_foo, _fooBar, _fooBar2) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo, _fooBar, _fooBar2) {
"use strict";
});
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-namespace/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-namespace/output.js
index b1b88602b1d5..5c79efde0967 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-namespace/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-namespace/output.js
@@ -11,7 +11,7 @@
global.foo = global.foo || {};
global.foo.bar = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-very-nested-namespace/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-very-nested-namespace/output.js
index bcae91ef8031..55ebfb1b8c30 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-very-nested-namespace/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-very-nested-namespace/output.js
@@ -13,7 +13,7 @@
global.foo.bar.baz = global.foo.bar.baz || {};
global.foo.bar.baz.qux = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global/output.js
index e643ca1729cf..0085a705c53a 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.baz = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id/output.js
index 2e8e731219b9..7dc12234cdb4 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id/output.js
@@ -10,7 +10,7 @@
factory();
global.MyLib = mod.exports;
}
-})(this, function () {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () {
"use strict";
foobar();
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name-with-overridden-global/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name-with-overridden-global/output.js
index 516c1e9a10c0..db9e9b200d7c 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name-with-overridden-global/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name-with-overridden-global/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.looseModuleNameWithOverriddenGlobalInput = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name/output.js
index 37b367916622..01c2ce86f9d3 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name/output.js
@@ -10,7 +10,7 @@
factory();
global.looseModuleNameInput = mod.exports;
}
-})(this, function () {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () {
"use strict";
foobar();
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/non-default-imports/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/non-default-imports/output.js
index a9273b54d4ba..10c4c15c9b6a 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/non-default-imports/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/non-default-imports/output.js
@@ -10,6 +10,6 @@
factory(global.render);
global.input = mod.exports;
}
-})(this, function (_render) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_render) {
"use strict";
});
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-export-name/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-export-name/output.js
index 406ad75ef7dc..5b666da90d2f 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-export-name/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-export-name/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-import-name/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-import-name/output.js
index 21f8cbe8bd64..c6850dc1ab1a 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-import-name/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-import-name/output.js
@@ -10,6 +10,6 @@
factory(global.Promise);
global.input = mod.exports;
}
-})(this, function (_es6Promise) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_es6Promise) {
"use strict";
});
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/overview/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/overview/output.js
index b66382de9469..0ec5e6cb6d88 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/overview/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/overview/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo, global.fooBar, global.fooBar);
global.input = mod.exports;
}
-})(this, function (_exports, foo2, _fooBar, _fooBar2) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, foo2, _fooBar, _fooBar2) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/remap/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/remap/output.js
index 32e24f80c89b..a8503bc29b96 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/remap/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/remap/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
_exports.__esModule = true;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/regression/4192/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/regression/4192/output.js
index 83495f9586e8..f0c22802cb37 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/regression/4192/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/regression/4192/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-10/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-10/output.js
index b4d81f7d48c9..49e75d5bc965 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-10/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-10/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-11/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-11/output.js
index 053cce392d75..5447cc116b68 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-11/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-11/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-2/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-2/output.js
index 91736c0197c2..04d3f90de328 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-2/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-2/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-3/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-3/output.js
index 3ca1ff7d7423..6579e72a0bdd 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-3/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-3/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-4/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-4/output.js
index 006b7c28772a..5478384d3bde 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-4/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-4/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-5/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-5/output.js
index e9d30703b26f..ae92ef86e76d 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-5/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-5/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-6/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-6/output.js
index 7fdc39f6adf3..38bb552b8f92 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-6/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-6/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-7/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-7/output.js
index 15cad508a21a..b5b988ee2090 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-7/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-7/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-8/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-8/output.js
index c92a85338f1b..a9d3a15498cd 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-8/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-8/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-9/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-9/output.js
index b6a052ac6671..e0c54835f5f6 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-9/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-9/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default/output.js
index 3f5a188475c0..3650a0e70afd 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-2/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-2/output.js
index fe946f300c70..24f7b0cac307 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-2/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-2/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-3/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-3/output.js
index 126e1be461b0..5d59222a6acc 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-3/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-3/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-4/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-4/output.js
index dc6f562b4e3a..a71a3dc3afa1 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-4/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-4/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-5/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-5/output.js
index f0381a2ddba0..c5806681062b 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-5/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-5/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-6/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-6/output.js
index ec9180133584..69ed1878b92c 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-6/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-6/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from/output.js
index 116bc257736a..3f4e37cb955c 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo);
global.input = mod.exports;
}
-})(this, function (_exports, _foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-2/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-2/output.js
index b6a052ac6671..e0c54835f5f6 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-2/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-2/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-3/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-3/output.js
index 7263e5f91f48..0174dbf05c23 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-3/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-3/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-4/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-4/output.js
index 14c4273fdc06..b39c6551907e 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-4/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-4/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-5/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-5/output.js
index 0ac1f5a990cc..ea7c9ea47720 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-5/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-5/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named/output.js
index 009aedbfef27..ba76f746df69 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/exports-variable/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/exports-variable/output.js
index 90292c4609f7..116ca5633a54 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/exports-variable/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/exports-variable/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/get-module-name-option/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/get-module-name-option/output.js
index d5c94066201a..9ef9726b81db 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/get-module-name-option/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/get-module-name-option/output.js
@@ -10,6 +10,6 @@
factory();
global.myCustomModuleName = mod.exports;
}
-})(this, function () {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () {
"use strict";
});
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/hoist-function-exports/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/hoist-function-exports/output.js
index f5427d448fd1..6b33b55fddfb 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/hoist-function-exports/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/hoist-function-exports/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.evens);
global.input = mod.exports;
}
-})(this, function (_exports, _evens) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _evens) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-default/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-default/output.js
index bdc895976fd3..733966a5af62 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-default/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-default/output.js
@@ -10,7 +10,7 @@
factory(global.foo);
global.input = mod.exports;
}
-})(this, function (_foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) {
"use strict";
_foo = babelHelpers.interopRequireDefault(_foo);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false-with-overrides/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false-with-overrides/output.js
index 79531c289ced..9d38e1ce05a6 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false-with-overrides/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false-with-overrides/output.js
@@ -10,7 +10,7 @@
factory(global.fooBAR, global.fooBAR, global.fizzBuzz);
global.input = mod.exports;
}
-})(this, function (_fooBar, _fooBar2, _fizzbuzz) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) {
"use strict";
_fooBar = babelHelpers.interopRequireDefault(_fooBar);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false/output.js
index 72d8bf864d29..18307048ec1b 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false/output.js
@@ -10,7 +10,7 @@
factory(global.fooBar, global.fooBar, global.fizzbuzz);
global.input = mod.exports;
}
-})(this, function (_fooBar, _fooBar2, _fizzbuzz) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) {
"use strict";
_fooBar = babelHelpers.interopRequireDefault(_fooBar);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true-with-overrides/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true-with-overrides/output.js
index bd083836e425..05b85cc76366 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true-with-overrides/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true-with-overrides/output.js
@@ -10,7 +10,7 @@
factory(global.fooBAR, global.mylib.fooBar, global.fizz.buzz);
global.input = mod.exports;
}
-})(this, function (_fooBar, _fooBar2, _fizzbuzz) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) {
"use strict";
_fooBar = babelHelpers.interopRequireDefault(_fooBar);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true/output.js
index c16c74d6d69c..baea395d1471 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true/output.js
@@ -10,7 +10,7 @@
factory(global.fooBar, global.mylibFooBar, global.fizzbuzz);
global.input = mod.exports;
}
-})(this, function (_fooBar, _fooBar2, _fizzbuzz) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) {
"use strict";
_fooBar = babelHelpers.interopRequireDefault(_fooBar);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-glob/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-glob/output.js
index 3f403ba8ad4a..2820bf461f2a 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-glob/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-glob/output.js
@@ -10,7 +10,7 @@
factory(global.foo);
global.input = mod.exports;
}
-})(this, function (foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (foo) {
"use strict";
foo = babelHelpers.interopRequireWildcard(foo);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-mixing/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-mixing/output.js
index f51c2d99aefa..37b9f152bef7 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-mixing/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-mixing/output.js
@@ -10,7 +10,7 @@
factory(global.foo);
global.input = mod.exports;
}
-})(this, function (_foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) {
"use strict";
_foo = babelHelpers.interopRequireWildcard(_foo);
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-named/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-named/output.js
index d0629b1666d4..f8fb2a0217cb 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-named/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-named/output.js
@@ -10,7 +10,7 @@
factory(global.foo);
global.input = mod.exports;
}
-})(this, function (_foo) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) {
"use strict";
_foo.bar;
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports/output.js
index c625f2ad0f13..0e773a28c17e 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports/output.js
@@ -10,6 +10,6 @@
factory(global.foo, global.fooBar, global.fooBar);
global.input = mod.exports;
}
-})(this, function (_foo, _fooBar, _fooBar2) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo, _fooBar, _fooBar2) {
"use strict";
});
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-namespace/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-namespace/output.js
index 3f43c9478122..b45744b06497 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-namespace/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-namespace/output.js
@@ -11,7 +11,7 @@
global.foo = global.foo || {};
global.foo.bar = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-very-nested-namespace/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-very-nested-namespace/output.js
index 1ddcae34725f..0b358a9b2079 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-very-nested-namespace/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-very-nested-namespace/output.js
@@ -13,7 +13,7 @@
global.foo.bar.baz = global.foo.bar.baz || {};
global.foo.bar.baz.qux = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global/output.js
index a9feedf65627..3a3fb1a0cb30 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.baz = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id/output.js
index 2e8e731219b9..7dc12234cdb4 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id/output.js
@@ -10,7 +10,7 @@
factory();
global.MyLib = mod.exports;
}
-})(this, function () {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () {
"use strict";
foobar();
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name-with-overridden-global/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name-with-overridden-global/output.js
index b17d582429ed..1d76a5b0d621 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name-with-overridden-global/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name-with-overridden-global/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.umdModuleNameWithOverriddenGlobalInput = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name/output.js
index 3967f520001c..07c787a92f28 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name/output.js
@@ -10,7 +10,7 @@
factory();
global.umdModuleNameInput = mod.exports;
}
-})(this, function () {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () {
"use strict";
foobar();
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/non-default-imports/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/non-default-imports/output.js
index a9273b54d4ba..10c4c15c9b6a 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/non-default-imports/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/non-default-imports/output.js
@@ -10,6 +10,6 @@
factory(global.render);
global.input = mod.exports;
}
-})(this, function (_render) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_render) {
"use strict";
});
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-export-name/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-export-name/output.js
index 3f5a188475c0..3650a0e70afd 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-export-name/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-export-name/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-import-name/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-import-name/output.js
index 21f8cbe8bd64..c6850dc1ab1a 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-import-name/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-import-name/output.js
@@ -10,6 +10,6 @@
factory(global.Promise);
global.input = mod.exports;
}
-})(this, function (_es6Promise) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_es6Promise) {
"use strict";
});
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/overview/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/overview/output.js
index e60dd5dcb0e2..4d7a91b32231 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/overview/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/overview/output.js
@@ -10,7 +10,7 @@
factory(mod.exports, global.foo, global.fooBar, global.fooBar);
global.input = mod.exports;
}
-})(this, function (_exports, foo2, _fooBar, _fooBar2) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, foo2, _fooBar, _fooBar2) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/remap/output.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/remap/output.js
index e5d904ca9981..c374f3aa7925 100644
--- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/remap/output.js
+++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/remap/output.js
@@ -10,7 +10,7 @@
factory(mod.exports);
global.input = mod.exports;
}
-})(this, function (_exports) {
+})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/output.js b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/output.js
index f66adb1fb317..8e25ad450629 100644
--- a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/output.js
+++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/output.js
@@ -1,3 +1,5 @@
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define([], factory);
@@ -10,7 +12,7 @@
factory();
global.input = mod.exports;
}
-})(this, function () {
+})((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === "object" ? globalThis : (typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" ? self : this, function () {
"use strict";
import("foo"); // warns
diff --git a/packages/babel-preset-env/test/fixtures/modules/modules-umd/output.js b/packages/babel-preset-env/test/fixtures/modules/modules-umd/output.js
index 231614902dde..5f1d193f306f 100644
--- a/packages/babel-preset-env/test/fixtures/modules/modules-umd/output.js
+++ b/packages/babel-preset-env/test/fixtures/modules/modules-umd/output.js
@@ -1,3 +1,5 @@
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["a"], factory);
@@ -10,7 +12,7 @@
factory(global.a);
global.input = mod.exports;
}
-})(this, function (_a) {
+})((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === "object" ? globalThis : (typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" ? self : this, function (_a) {
"use strict";
_a = _interopRequireDefault(_a);
From 4b3a19ea9f61d557e589dfdef21da02e752dad21 Mon Sep 17 00:00:00 2001
From: Vivek Nayyar
Date: Wed, 30 Oct 2019 03:02:02 +0530
Subject: [PATCH 021/648] fixed missing errors on assignment pattern in object
expression (#10607)
* :bug: fixed missing errors on assignment pattern in object expression
* :recycle: remove a non-needed comment
* :bug: missed adding comma in the test input
* :bug: fixed the failing valid-property-initializer test
---
.../babel-parser/src/parser/expression.js | 5 +-
.../invalid-property-initializer-1/input.js | 4 +
.../options.json | 3 +
.../invalid-property-initializer/input.js | 4 +
.../invalid-property-initializer/options.json | 3 +
.../valid-property-initializer/input.js | 4 +
.../valid-property-initializer/output.json | 425 ++++++++++++++++++
7 files changed, 447 insertions(+), 1 deletion(-)
create mode 100644 packages/babel-parser/test/fixtures/core/object/invalid-property-initializer-1/input.js
create mode 100644 packages/babel-parser/test/fixtures/core/object/invalid-property-initializer-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/object/invalid-property-initializer/input.js
create mode 100644 packages/babel-parser/test/fixtures/core/object/invalid-property-initializer/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/object/valid-property-initializer/input.js
create mode 100644 packages/babel-parser/test/fixtures/core/object/valid-property-initializer/output.json
diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js
index 04299e439830..79abd269e184 100644
--- a/packages/babel-parser/src/parser/expression.js
+++ b/packages/babel-parser/src/parser/expression.js
@@ -204,7 +204,10 @@ export default class ExpressionParser extends LValParser {
node.left = this.match(tt.eq)
? this.toAssignable(left, undefined, "assignment expression")
: left;
- refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly
+
+ if (refShorthandDefaultPos.start >= node.left.start) {
+ refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly
+ }
this.checkLVal(left, undefined, undefined, "assignment expression");
diff --git a/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer-1/input.js b/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer-1/input.js
new file mode 100644
index 000000000000..9538075c50c3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer-1/input.js
@@ -0,0 +1,4 @@
+const obj = {
+ bar: x = 123,
+ foo = 123
+};
diff --git a/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer-1/options.json b/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer-1/options.json
new file mode 100644
index 000000000000..e92fc4e28742
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer-1/options.json
@@ -0,0 +1,3 @@
+{
+ "throws": "Unexpected token (3:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer/input.js b/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer/input.js
new file mode 100644
index 000000000000..868f237838df
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer/input.js
@@ -0,0 +1,4 @@
+const obj = {
+ foo = 123,
+ bar: x = 123
+};
diff --git a/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer/options.json b/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer/options.json
new file mode 100644
index 000000000000..9660494a29ea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/object/invalid-property-initializer/options.json
@@ -0,0 +1,3 @@
+{
+ "throws": "Unexpected token (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/input.js b/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/input.js
new file mode 100644
index 000000000000..0cd0f5146c8d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/input.js
@@ -0,0 +1,4 @@
+const obj = {
+ foo = 123,
+ bar: x = 123,
+} = { foo: 24, bar: 45 };
diff --git a/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/output.json b/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/output.json
new file mode 100644
index 000000000000..7b1a47d91e7a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/output.json
@@ -0,0 +1,425 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ },
+ "init": {
+ "type": "AssignmentExpression",
+ "start": 12,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 12,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 16,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "AssignmentPattern",
+ "start": 16,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 123,
+ "raw": "123"
+ },
+ "value": 123
+ }
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 29,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "AssignmentPattern",
+ "start": 34,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 38,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 123,
+ "raw": "123"
+ },
+ "value": 123
+ }
+ }
+ }
+ ],
+ "extra": {
+ "trailingComma": 41
+ }
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 47,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 49,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 54,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 24,
+ "raw": "24"
+ },
+ "value": 24
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 58,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 63,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 20
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ }
+ },
+ "extra": {
+ "rawValue": 45,
+ "raw": "45"
+ },
+ "value": 45
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
From ec3345bb57f6e50244ef569a001b1f5e5feab3ec Mon Sep 17 00:00:00 2001
From: George Zahariev
Date: Tue, 29 Oct 2019 14:55:12 -0700
Subject: [PATCH 022/648] Flow enums parsing (#10344)
* Flow enums parsing
* Parse exporting enums
* Enums parsing remove lookahead, other improvements
* Enums: add EnumBody and EnumMember aliases, change boolean members to use BooleaLiteral value
* Fix enum member init flow type, now that boolean members have a BooleanLiteral value
* Flow enums: use contextual utils, change members length checks to use logic operators, remove reserved word logic modification
* Flow enums: remove unnecessary code in generator, fix error message
---
.../babel-generator/src/generators/flow.js | 86 ++++
.../fixtures/flow/enum-declaration/input.js | 36 ++
.../flow/enum-declaration/options.json | 3 +
.../fixtures/flow/enum-declaration/output.js | 36 ++
packages/babel-parser/src/plugins/flow.js | 456 +++++++++++++++++-
.../boolean-explicit/input.js | 4 +
.../boolean-explicit/output.json | 181 +++++++
.../boolean-implicit/input.js | 4 +
.../boolean-implicit/output.json | 181 +++++++
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 4 +
.../options.json | 4 +
.../duplicate-member-name/input.js | 4 +
.../duplicate-member-name/options.json | 4 +
.../flow/enum-declaration/empty/input.js | 1 +
.../flow/enum-declaration/empty/output.json | 84 ++++
.../enum-declaration/end-of-file/input.js | 1 +
.../enum-declaration/end-of-file/options.json | 4 +
.../flow/enum-declaration/enum-name/input.js | 2 +
.../enum-declaration/enum-name/output.json | 84 ++++
.../flow/enum-declaration/export/input.js | 3 +
.../flow/enum-declaration/export/options.json | 11 +
.../flow/enum-declaration/export/output.json | 166 +++++++
.../input.js | 5 +
.../options.json | 4 +
.../input.js | 4 +
.../options.json | 4 +
.../invalid-explicit-type-expression/input.js | 2 +
.../options.json | 4 +
.../invalid-explicit-type-identifier/input.js | 2 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 3 +
.../options.json | 4 +
.../invalid-member-name/input.js | 4 +
.../invalid-member-name/options.json | 4 +
.../no-trailing-comma/input.js | 3 +
.../no-trailing-comma/output.json | 117 +++++
.../enum-declaration/number-explicit/input.js | 4 +
.../number-explicit/output.json | 189 ++++++++
.../enum-declaration/number-implicit/input.js | 4 +
.../number-implicit/output.json | 189 ++++++++
.../input.js | 3 +
.../options.json | 4 +
.../input.js | 4 +
.../options.json | 4 +
.../flow/enum-declaration/options.json | 3 +
.../reserved-word-enum-name/input.js | 2 +
.../reserved-word-enum-name/options.json | 4 +
.../string-explicit-defaulted/input.js | 4 +
.../string-explicit-defaulted/output.json | 149 ++++++
.../string-explicit-initialized/input.js | 4 +
.../string-explicit-initialized/output.json | 189 ++++++++
.../string-implicit-defaulted/input.js | 4 +
.../string-implicit-defaulted/output.json | 149 ++++++
.../string-implicit-initialized/input.js | 4 +
.../string-implicit-initialized/output.json | 189 ++++++++
.../input.js | 5 +
.../options.json | 4 +
.../input.js | 5 +
.../options.json | 4 +
.../flow/enum-declaration/symbol/input.js | 4 +
.../flow/enum-declaration/symbol/output.json | 148 ++++++
.../legacy-regression/10264/options.json | 2 +-
.../babel-plugin-syntax-flow/src/index.js | 8 +-
.../src/asserts/generated/index.js | 39 ++
.../src/builders/generated/index.js | 36 ++
.../src/constants/generated/index.js | 2 +
packages/babel-types/src/definitions/flow.js | 86 ++++
.../src/validators/generated/index.js | 166 +++++++
92 files changed, 3213 insertions(+), 5 deletions(-)
create mode 100644 packages/babel-generator/test/fixtures/flow/enum-declaration/input.js
create mode 100644 packages/babel-generator/test/fixtures/flow/enum-declaration/options.json
create mode 100644 packages/babel-generator/test/fixtures/flow/enum-declaration/output.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/empty/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/end-of-file/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/end-of-file/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/export/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-expression/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-expression/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-boolean/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-boolean/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-number/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-number/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-string/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-string/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-symbol/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-symbol/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-implicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-implicit/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/input.js
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json
diff --git a/packages/babel-generator/src/generators/flow.js b/packages/babel-generator/src/generators/flow.js
index 225428b00801..9a8441ba827c 100644
--- a/packages/babel-generator/src/generators/flow.js
+++ b/packages/babel-generator/src/generators/flow.js
@@ -134,6 +134,92 @@ export function DeclareExportAllDeclaration(/*node: Object*/) {
ExportAllDeclaration.apply(this, arguments);
}
+export function EnumDeclaration(node: Object) {
+ const { id, body } = node;
+ this.word("enum");
+ this.space();
+ this.print(id, node);
+ this.print(body, node);
+}
+
+function enumExplicitType(
+ context: Object,
+ name: string,
+ hasExplicitType: boolean,
+) {
+ if (hasExplicitType) {
+ context.space();
+ context.word("of");
+ context.space();
+ context.word(name);
+ }
+ context.space();
+}
+
+function enumBody(context: Object, node: Object) {
+ const { members } = node;
+ context.token("{");
+ context.indent();
+ context.newline();
+ for (const member of members) {
+ context.print(member, node);
+ context.newline();
+ }
+ context.dedent();
+ context.token("}");
+}
+
+export function EnumBooleanBody(node: Object) {
+ const { explicitType } = node;
+ enumExplicitType(this, "boolean", explicitType);
+ enumBody(this, node);
+}
+
+export function EnumNumberBody(node: Object) {
+ const { explicitType } = node;
+ enumExplicitType(this, "number", explicitType);
+ enumBody(this, node);
+}
+
+export function EnumStringBody(node: Object) {
+ const { explicitType } = node;
+ enumExplicitType(this, "string", explicitType);
+ enumBody(this, node);
+}
+
+export function EnumSymbolBody(node: Object) {
+ enumExplicitType(this, "symbol", true);
+ enumBody(this, node);
+}
+
+export function EnumDefaultedMember(node: Object) {
+ const { id } = node;
+ this.print(id, node);
+ this.token(",");
+}
+
+function enumInitializedMember(context: Object, node: Object) {
+ const { id, init } = node;
+ context.print(id, node);
+ context.space();
+ context.token("=");
+ context.space();
+ context.print(init, node);
+ context.token(",");
+}
+
+export function EnumBooleanMember(node: Object) {
+ enumInitializedMember(this, node);
+}
+
+export function EnumNumberMember(node: Object) {
+ enumInitializedMember(this, node);
+}
+
+export function EnumStringMember(node: Object) {
+ enumInitializedMember(this, node);
+}
+
function FlowExportDeclaration(node: Object) {
if (node.declaration) {
const declar = node.declaration;
diff --git a/packages/babel-generator/test/fixtures/flow/enum-declaration/input.js b/packages/babel-generator/test/fixtures/flow/enum-declaration/input.js
new file mode 100644
index 000000000000..f59944f78e18
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/flow/enum-declaration/input.js
@@ -0,0 +1,36 @@
+enum E {
+ A = true,
+ B = false,
+}
+enum E of boolean {
+ A = true,
+ B = false,
+}
+enum E {
+ A = 1,
+ B = 2,
+}
+enum E of number {
+ A = 1,
+ B = 2,
+}
+enum E {
+ A,
+ B,
+}
+enum E of string {
+ A,
+ B,
+}
+enum E {
+ A = "a",
+ B = "b",
+}
+enum E of string {
+ A = "a",
+ B = "b",
+}
+enum E of symbol {
+ A,
+ B,
+}
diff --git a/packages/babel-generator/test/fixtures/flow/enum-declaration/options.json b/packages/babel-generator/test/fixtures/flow/enum-declaration/options.json
new file mode 100644
index 000000000000..53fd48c051cb
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/flow/enum-declaration/options.json
@@ -0,0 +1,3 @@
+{
+ "plugins": [["flow", { "enums": true }]]
+}
diff --git a/packages/babel-generator/test/fixtures/flow/enum-declaration/output.js b/packages/babel-generator/test/fixtures/flow/enum-declaration/output.js
new file mode 100644
index 000000000000..f59944f78e18
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/flow/enum-declaration/output.js
@@ -0,0 +1,36 @@
+enum E {
+ A = true,
+ B = false,
+}
+enum E of boolean {
+ A = true,
+ B = false,
+}
+enum E {
+ A = 1,
+ B = 2,
+}
+enum E of number {
+ A = 1,
+ B = 2,
+}
+enum E {
+ A,
+ B,
+}
+enum E of string {
+ A,
+ B,
+}
+enum E {
+ A = "a",
+ B = "b",
+}
+enum E of string {
+ A = "a",
+ B = "b",
+}
+enum E of symbol {
+ A,
+ B,
+}
diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js
index 867c31243010..d4c815d38b45 100644
--- a/packages/babel-parser/src/plugins/flow.js
+++ b/packages/babel-parser/src/plugins/flow.js
@@ -81,6 +81,20 @@ function partition(
const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
+// Flow enums types
+type EnumExplicitType = null | "boolean" | "number" | "string" | "symbol";
+type EnumContext = {|
+ enumName: string,
+ explicitType: EnumExplicitType,
+ memberName: string,
+|};
+type EnumMemberInit =
+ | {| type: "number", pos: number, value: N.Node |}
+ | {| type: "string", pos: number, value: N.Node |}
+ | {| type: "boolean", pos: number, value: N.Node |}
+ | {| type: "invalid", pos: number |}
+ | {| type: "none", pos: number |};
+
export default (superClass: Class): Class =>
class extends superClass {
// The value of the @flow/@noflow pragma. Initially undefined, transitions
@@ -97,6 +111,10 @@ export default (superClass: Class): Class =>
return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
}
+ shouldParseEnums(): boolean {
+ return !!this.getPluginOption("flow", "enums");
+ }
+
finishToken(type: TokenType, val: any): void {
if (
type !== tt.string &&
@@ -1604,7 +1622,7 @@ export default (superClass: Class): Class =>
super.parseFunctionBodyAndFinish(node, type, isMethod);
}
- // interfaces
+ // interfaces and enums
parseStatement(context: ?string, topLevel?: boolean): N.Statement {
// strict mode handling of `interface` since it's a reserved word
if (
@@ -1615,6 +1633,10 @@ export default (superClass: Class): Class =>
const node = this.startNode();
this.next();
return this.flowParseInterface(node);
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
} else {
const stmt = super.parseStatement(context, topLevel);
// We will parse a flow pragma in any comment before the first statement.
@@ -1661,6 +1683,7 @@ export default (superClass: Class): Class =>
this.isContextual("type") ||
this.isContextual("interface") ||
this.isContextual("opaque") ||
+ (this.shouldParseEnums() && this.isContextual("enum")) ||
super.shouldParseExportDeclaration()
);
}
@@ -1670,7 +1693,8 @@ export default (superClass: Class): Class =>
this.match(tt.name) &&
(this.state.value === "type" ||
this.state.value === "interface" ||
- this.state.value === "opaque")
+ this.state.value === "opaque" ||
+ (this.shouldParseEnums() && this.state.value === "enum"))
) {
return false;
}
@@ -1678,6 +1702,15 @@ export default (superClass: Class): Class =>
return super.isExportDefaultSpecifier();
}
+ parseExportDefaultExpression(): N.Expression | N.Declaration {
+ if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+ return super.parseExportDefaultExpression();
+ }
+
parseConditional(
expr: N.Expression,
noIn: ?boolean,
@@ -1935,6 +1968,11 @@ export default (superClass: Class): Class =>
const declarationNode = this.startNode();
this.next();
return this.flowParseInterface(declarationNode);
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ node.exportKind = "value";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(declarationNode);
} else {
return super.parseExportDeclaration(node);
}
@@ -2839,4 +2877,418 @@ export default (superClass: Class): Class =>
this.raise(this.state.pos, "Unterminated comment");
}
}
+
+ // Flow enum parsing
+
+ flowEnumErrorBooleanMemberNotInitialized(
+ pos: number,
+ { enumName, memberName }: { enumName: string, memberName: string },
+ ): void {
+ this.raise(
+ pos,
+ `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` ` +
+ `or \`${memberName} = false,\` in enum \`${enumName}\`.`,
+ );
+ }
+
+ flowEnumErrorInvalidMemberName(
+ pos: number,
+ { enumName, memberName }: { enumName: string, memberName: string },
+ ): void {
+ const suggestion = memberName[0].toUpperCase() + memberName.slice(1);
+ this.raise(
+ pos,
+ `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using ` +
+ `\`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`,
+ );
+ }
+
+ flowEnumErrorDuplicateMemberName(
+ pos: number,
+ { enumName, memberName }: { enumName: string, memberName: string },
+ ): void {
+ this.raise(
+ pos,
+ `Enum member names need to be unique, but the name \`${memberName}\` has already been used ` +
+ `before in enum \`${enumName}\`.`,
+ );
+ }
+
+ flowEnumErrorInconsistentMemberValues(
+ pos: number,
+ { enumName }: { enumName: string },
+ ): void {
+ this.raise(
+ pos,
+ `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or ` +
+ `consistently use literals (either booleans, numbers, or strings) for all member initializers.`,
+ );
+ }
+
+ flowEnumErrorInvalidExplicitType(
+ pos: number,
+ {
+ enumName,
+ suppliedType,
+ }: { enumName: string, suppliedType: null | string },
+ ): void {
+ const suggestion =
+ `Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in ` +
+ `enum \`${enumName}\`.`;
+ const message =
+ suppliedType === null
+ ? `Supplied enum type is not valid. ${suggestion}`
+ : `Enum type \`${suppliedType}\` is not valid. ${suggestion}`;
+ this.raise(pos, message);
+ }
+
+ flowEnumErrorInvalidMemberInitializer(
+ pos: number,
+ { enumName, explicitType, memberName }: EnumContext,
+ ): void {
+ let message = null;
+ switch (explicitType) {
+ case "boolean":
+ case "number":
+ case "string":
+ message =
+ `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of ` +
+ `\`${memberName}\` needs to be a ${explicitType} literal.`;
+ break;
+ case "symbol":
+ message =
+ `Symbol enum members cannot be initialized. Use \`${memberName},\` in ` +
+ `enum \`${enumName}\`.`;
+ break;
+ default:
+ // null
+ message =
+ `The enum member initializer for \`${memberName}\` needs to be a literal (either ` +
+ `a boolean, number, or string) in enum \`${enumName}\`.`;
+ }
+ this.raise(pos, message);
+ }
+
+ flowEnumErrorNumberMemberNotInitialized(
+ pos: number,
+ { enumName, memberName }: { enumName: string, memberName: string },
+ ): void {
+ this.raise(
+ pos,
+ `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`,
+ );
+ }
+
+ flowEnumErrorStringMemberInconsistentlyInitailized(
+ pos: number,
+ { enumName }: { enumName: string },
+ ): void {
+ this.raise(
+ pos,
+ `String enum members need to consistently either all use initializers, or use no initializers, ` +
+ `in enum \`${enumName}\`.`,
+ );
+ }
+
+ flowEnumMemberInit(): EnumMemberInit {
+ const startPos = this.state.start;
+ const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);
+ switch (this.state.type) {
+ case tt.num: {
+ const literal = this.parseLiteral(this.state.value, "NumericLiteral");
+ if (endOfInit()) {
+ return { type: "number", pos: literal.start, value: literal };
+ }
+ return { type: "invalid", pos: startPos };
+ }
+ case tt.string: {
+ const literal = this.parseLiteral(this.state.value, "StringLiteral");
+ if (endOfInit()) {
+ return { type: "string", pos: literal.start, value: literal };
+ }
+ return { type: "invalid", pos: startPos };
+ }
+ case tt._true:
+ case tt._false: {
+ const literal = this.parseBooleanLiteral();
+ if (endOfInit()) {
+ return {
+ type: "boolean",
+ pos: literal.start,
+ value: literal,
+ };
+ }
+ return { type: "invalid", pos: startPos };
+ }
+ default:
+ return { type: "invalid", pos: startPos };
+ }
+ }
+
+ flowEnumMemberRaw(): { id: N.Node, init: EnumMemberInit } {
+ const pos = this.state.start;
+ const id = this.parseIdentifier(true);
+ const init = this.eat(tt.eq)
+ ? this.flowEnumMemberInit()
+ : { type: "none", pos };
+ return { id, init };
+ }
+
+ flowEnumCheckExplicitTypeMismatch(
+ pos: number,
+ context: EnumContext,
+ expectedType: EnumExplicitType,
+ ): void {
+ const { explicitType } = context;
+ if (explicitType === null) {
+ return;
+ }
+ if (explicitType !== expectedType) {
+ this.flowEnumErrorInvalidMemberInitializer(pos, context);
+ }
+ }
+
+ flowEnumMembers({
+ enumName,
+ explicitType,
+ }: {
+ enumName: string,
+ explicitType: EnumExplicitType,
+ }): {|
+ booleanMembers: Array,
+ numberMembers: Array,
+ stringMembers: Array,
+ defaultedMembers: Array,
+ |} {
+ const seenNames = new Set();
+ const members = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: [],
+ };
+ while (!this.match(tt.braceR)) {
+ const memberNode = this.startNode();
+ const { id, init } = this.flowEnumMemberRaw();
+ const memberName = id.name;
+ if (memberName === "") {
+ continue;
+ }
+ if (/^[a-z]/.test(memberName)) {
+ this.flowEnumErrorInvalidMemberName(id.start, {
+ enumName,
+ memberName,
+ });
+ }
+ if (seenNames.has(memberName)) {
+ this.flowEnumErrorDuplicateMemberName(id.start, {
+ enumName,
+ memberName,
+ });
+ }
+ seenNames.add(memberName);
+ const context = { enumName, explicitType, memberName };
+ memberNode.id = id;
+ switch (init.type) {
+ case "boolean": {
+ this.flowEnumCheckExplicitTypeMismatch(
+ init.pos,
+ context,
+ "boolean",
+ );
+ memberNode.init = init.value;
+ members.booleanMembers.push(
+ this.finishNode(memberNode, "EnumBooleanMember"),
+ );
+ break;
+ }
+ case "number": {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number");
+ memberNode.init = init.value;
+ members.numberMembers.push(
+ this.finishNode(memberNode, "EnumNumberMember"),
+ );
+ break;
+ }
+ case "string": {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string");
+ memberNode.init = init.value;
+ members.stringMembers.push(
+ this.finishNode(memberNode, "EnumStringMember"),
+ );
+ break;
+ }
+ case "invalid": {
+ this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
+ break;
+ }
+ case "none": {
+ switch (explicitType) {
+ case "boolean":
+ this.flowEnumErrorBooleanMemberNotInitialized(
+ init.pos,
+ context,
+ );
+ break;
+ case "number":
+ this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);
+ break;
+ default:
+ members.defaultedMembers.push(
+ this.finishNode(memberNode, "EnumDefaultedMember"),
+ );
+ }
+ }
+ }
+
+ if (!this.match(tt.braceR)) {
+ this.expect(tt.comma);
+ }
+ }
+ return members;
+ }
+
+ flowEnumStringBody(
+ bodyNode: N.Node,
+ initializedMembers: Array,
+ defaultedMembers: Array,
+ { enumName }: { enumName: string },
+ ): N.Node {
+ if (initializedMembers.length === 0) {
+ bodyNode.members = defaultedMembers;
+ } else if (defaultedMembers.length === 0) {
+ bodyNode.members = initializedMembers;
+ } else if (defaultedMembers.length > initializedMembers.length) {
+ bodyNode.members = defaultedMembers;
+ for (const member of initializedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(
+ member.start,
+ { enumName },
+ );
+ }
+ } else {
+ bodyNode.members = initializedMembers;
+ for (const member of defaultedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(
+ member.start,
+ { enumName },
+ );
+ }
+ }
+ return this.finishNode(bodyNode, "EnumStringBody");
+ }
+
+ flowEnumParseExplicitType({
+ enumName,
+ }: {
+ enumName: string,
+ }): EnumExplicitType {
+ if (this.eatContextual("of")) {
+ if (this.match(tt.name)) {
+ switch (this.state.value) {
+ case "boolean":
+ case "number":
+ case "string":
+ case "symbol": {
+ const explicitType = this.state.value;
+ this.next();
+ return explicitType;
+ }
+ default:
+ this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: this.state.value,
+ });
+ }
+ } else {
+ this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: null,
+ });
+ }
+ }
+ return null;
+ }
+
+ flowParseEnumDeclaration(node: N.Node): N.Node {
+ const id = this.parseIdentifier();
+ node.id = id;
+ const enumName = id.name;
+ const explicitType = this.flowEnumParseExplicitType({ enumName });
+ this.expect(tt.braceL);
+ const bodyNode = this.startNode();
+ const members = this.flowEnumMembers({ enumName, explicitType });
+
+ switch (explicitType) {
+ case "boolean":
+ bodyNode.explicitType = true;
+ bodyNode.members = members.booleanMembers;
+ node.body = this.finishNode(bodyNode, "EnumBooleanBody");
+ break;
+ case "number":
+ bodyNode.explicitType = true;
+ bodyNode.members = members.numberMembers;
+ node.body = this.finishNode(bodyNode, "EnumNumberBody");
+ break;
+ case "string":
+ bodyNode.explicitType = true;
+ node.body = this.flowEnumStringBody(
+ bodyNode,
+ members.stringMembers,
+ members.defaultedMembers,
+ { enumName },
+ );
+ break;
+ case "symbol":
+ bodyNode.members = members.defaultedMembers;
+ node.body = this.finishNode(bodyNode, "EnumSymbolBody");
+ break;
+ default: {
+ // null
+ const empty = () => {
+ bodyNode.members = [];
+ return this.finishNode(bodyNode, "EnumStringBody");
+ };
+ bodyNode.explicitType = false;
+ const boolsLen = members.booleanMembers.length;
+ const numsLen = members.numberMembers.length;
+ const strsLen = members.stringMembers.length;
+ const defaultedLen = members.defaultedMembers.length;
+
+ if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
+ node.body = empty();
+ } else if (!boolsLen && !numsLen) {
+ node.body = this.flowEnumStringBody(
+ bodyNode,
+ members.stringMembers,
+ members.defaultedMembers,
+ { enumName },
+ );
+ } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
+ bodyNode.members = members.booleanMembers;
+ node.body = this.finishNode(bodyNode, "EnumBooleanBody");
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name,
+ });
+ }
+ } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
+ bodyNode.members = members.numberMembers;
+ node.body = this.finishNode(bodyNode, "EnumNumberBody");
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorNumberMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name,
+ });
+ }
+ } else {
+ node.body = empty();
+ this.flowEnumErrorInconsistentMemberValues(id.start, { enumName });
+ }
+ }
+ }
+ this.expect(tt.braceR);
+ return this.finishNode(node, "EnumDeclaration");
+ }
};
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/input.js
new file mode 100644
index 000000000000..7b63f4eb2962
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/input.js
@@ -0,0 +1,4 @@
+enum E of boolean {
+ A = true,
+ B = false,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/output.json
new file mode 100644
index 000000000000..df48f24b108b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/output.json
@@ -0,0 +1,181 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumBooleanBody",
+ "start": 22,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "explicitType": true,
+ "members": [
+ {
+ "type": "EnumBooleanMember",
+ "start": 22,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "BooleanLiteral",
+ "start": 26,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": true
+ }
+ },
+ {
+ "type": "EnumBooleanMember",
+ "start": 34,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "BooleanLiteral",
+ "start": 38,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": false
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/input.js
new file mode 100644
index 000000000000..6ab49ea7b2b8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/input.js
@@ -0,0 +1,4 @@
+enum E {
+ A = true,
+ B = false,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/output.json
new file mode 100644
index 000000000000..d7d3bae2e7c4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/output.json
@@ -0,0 +1,181 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumBooleanBody",
+ "start": 11,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumBooleanMember",
+ "start": 11,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "BooleanLiteral",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": true
+ }
+ },
+ {
+ "type": "EnumBooleanMember",
+ "start": 23,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "BooleanLiteral",
+ "start": 27,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": false
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/input.js
new file mode 100644
index 000000000000..4fecb537fb2e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/input.js
@@ -0,0 +1,3 @@
+enum E of boolean {
+ A,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json
new file mode 100644
index 000000000000..b3b5dfd8b08f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/input.js
new file mode 100644
index 000000000000..73704345dc4b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/input.js
@@ -0,0 +1,4 @@
+enum E {
+ A,
+ B = true,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json
new file mode 100644
index 000000000000..b3b5dfd8b08f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/input.js
new file mode 100644
index 000000000000..c9fde50253ac
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/input.js
@@ -0,0 +1,4 @@
+enum E {
+ A,
+ A,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json
new file mode 100644
index 000000000000..d769b33ba2c2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum member names need to be unique, but the name `A` has already been used before in enum `E`. (3:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/input.js
new file mode 100644
index 000000000000..714f607bf333
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/input.js
@@ -0,0 +1 @@
+enum E { }
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json
new file mode 100644
index 000000000000..336475b12dd5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json
@@ -0,0 +1,84 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 9,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "explicitType": false,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/end-of-file/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/end-of-file/input.js
new file mode 100644
index 000000000000..e3caefb45c49
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/end-of-file/input.js
@@ -0,0 +1 @@
+enum
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/end-of-file/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/end-of-file/options.json
new file mode 100644
index 000000000000..030f339842d5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/end-of-file/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Unexpected token (1:4)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/input.js
new file mode 100644
index 000000000000..8d057902fa7e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/input.js
@@ -0,0 +1,2 @@
+enum type {
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/output.json
new file mode 100644
index 000000000000..57bea3fab460
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/output.json
@@ -0,0 +1,84 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "type"
+ },
+ "name": "type"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 12,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "explicitType": false,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/input.js
new file mode 100644
index 000000000000..ebdc5a4a8bb8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/input.js
@@ -0,0 +1,3 @@
+export enum A {}
+
+export default enum B {}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json
new file mode 100644
index 000000000000..f17ece27cf57
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json
@@ -0,0 +1,11 @@
+{
+ "plugins": [
+ [
+ "flow",
+ {
+ "enums": true
+ }
+ ]
+ ],
+ "sourceType": "module"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json
new file mode 100644
index 000000000000..5762ca30b575
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "exportKind": "value",
+ "declaration": {
+ "type": "EnumDeclaration",
+ "start": 7,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 15,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "explicitType": false,
+ "members": []
+ }
+ }
+ },
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 18,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "declaration": {
+ "type": "EnumDeclaration",
+ "start": 33,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 41,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "explicitType": false,
+ "members": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/input.js
new file mode 100644
index 000000000000..5a639f107119
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/input.js
@@ -0,0 +1,5 @@
+enum E {
+ A,
+ B,
+ C = 3,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json
new file mode 100644
index 000000000000..3dbe8477d0ab
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/input.js
new file mode 100644
index 000000000000..b0b10ec4d43a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/input.js
@@ -0,0 +1,4 @@
+enum E {
+ A = 1,
+ B = true,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json
new file mode 100644
index 000000000000..3dbe8477d0ab
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-expression/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-expression/input.js
new file mode 100644
index 000000000000..e3353ef78879
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-expression/input.js
@@ -0,0 +1,2 @@
+enum E of [] {
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-expression/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-expression/options.json
new file mode 100644
index 000000000000..9916e88639b9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-expression/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `E`. (1:10)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/input.js
new file mode 100644
index 000000000000..25bbeb7024e8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/input.js
@@ -0,0 +1,2 @@
+enum E of xxx {
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json
new file mode 100644
index 000000000000..7684531c52f1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum type `xxx` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `E`. (1:10)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/input.js
new file mode 100644
index 000000000000..31e79ef9f119
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/input.js
@@ -0,0 +1,3 @@
+enum E of string {
+ A = true,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json
new file mode 100644
index 000000000000..1587909dd62e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-boolean/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-boolean/input.js
new file mode 100644
index 000000000000..d4f1afa92f09
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-boolean/input.js
@@ -0,0 +1,3 @@
+enum E of boolean {
+ A = 1 + 2,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-boolean/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-boolean/options.json
new file mode 100644
index 000000000000..14ed173defa0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-boolean/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-number/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-number/input.js
new file mode 100644
index 000000000000..a6f7ed2152c2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-number/input.js
@@ -0,0 +1,3 @@
+enum E of number {
+ A = 1 + 2,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-number/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-number/options.json
new file mode 100644
index 000000000000..7a8a81f75442
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-number/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has type `number`, so the initializer of `A` needs to be a number literal. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-string/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-string/input.js
new file mode 100644
index 000000000000..704efcf615b5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-string/input.js
@@ -0,0 +1,3 @@
+enum E of string {
+ A = 1 + 2,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-string/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-string/options.json
new file mode 100644
index 000000000000..1587909dd62e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-string/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-symbol/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-symbol/input.js
new file mode 100644
index 000000000000..d4acb6dfd235
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-symbol/input.js
@@ -0,0 +1,3 @@
+enum E of symbol {
+ A = 1 + 2,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-symbol/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-symbol/options.json
new file mode 100644
index 000000000000..e9b2692f126a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-explicit-symbol/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Symbol enum members cannot be initialized. Use `A,` in enum `E`. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-implicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-implicit/input.js
new file mode 100644
index 000000000000..bed31f7fdc1c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-implicit/input.js
@@ -0,0 +1,3 @@
+enum E {
+ A = 1 + 2,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-implicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-implicit/options.json
new file mode 100644
index 000000000000..282f44e03ab4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-expression-implicit/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "The enum member initializer for `A` needs to be a literal (either a boolean, number, or string) in enum `E`. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/input.js
new file mode 100644
index 000000000000..dc8429b75342
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/input.js
@@ -0,0 +1,3 @@
+enum E of symbol {
+ A = 1,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json
new file mode 100644
index 000000000000..e9b2692f126a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Symbol enum members cannot be initialized. Use `A,` in enum `E`. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/input.js
new file mode 100644
index 000000000000..81e1097efdd9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/input.js
@@ -0,0 +1,3 @@
+enum E of boolean {
+ A = 1,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json
new file mode 100644
index 000000000000..14ed173defa0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/input.js
new file mode 100644
index 000000000000..708914906e1d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/input.js
@@ -0,0 +1,3 @@
+enum E of string {
+ A = 1,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json
new file mode 100644
index 000000000000..1587909dd62e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/input.js
new file mode 100644
index 000000000000..92cc2012d905
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/input.js
@@ -0,0 +1,3 @@
+enum E {
+ A = (1),
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json
new file mode 100644
index 000000000000..282f44e03ab4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "The enum member initializer for `A` needs to be a literal (either a boolean, number, or string) in enum `E`. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/input.js
new file mode 100644
index 000000000000..86674e7f2053
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/input.js
@@ -0,0 +1,3 @@
+enum E of boolean {
+ A = "hi",
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json
new file mode 100644
index 000000000000..14ed173defa0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/input.js
new file mode 100644
index 000000000000..5b0a7937af0a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/input.js
@@ -0,0 +1,3 @@
+enum E of number {
+ A = "hi",
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json
new file mode 100644
index 000000000000..7a8a81f75442
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum `E` has type `number`, so the initializer of `A` needs to be a number literal. (2:6)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/input.js
new file mode 100644
index 000000000000..3604a85bb2d4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/input.js
@@ -0,0 +1,4 @@
+enum E {
+ foo,
+ bar,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json
new file mode 100644
index 000000000000..3a3974fd4b9d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `foo`, consider using `Foo`, in enum `E`. (2:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/input.js
new file mode 100644
index 000000000000..228a928299de
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/input.js
@@ -0,0 +1,3 @@
+enum E {
+ A
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/output.json
new file mode 100644
index 000000000000..ed614a856575
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/output.json
@@ -0,0 +1,117 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumDefaultedMember",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/input.js
new file mode 100644
index 000000000000..f597c5898aa0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/input.js
@@ -0,0 +1,4 @@
+enum E of number {
+ A = 1,
+ B = 2,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/output.json
new file mode 100644
index 000000000000..4f5a6f26c614
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumNumberBody",
+ "start": 21,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "explicitType": true,
+ "members": [
+ {
+ "type": "EnumNumberMember",
+ "start": 21,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ {
+ "type": "EnumNumberMember",
+ "start": 30,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/input.js
new file mode 100644
index 000000000000..1b99bb7ff34a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/input.js
@@ -0,0 +1,4 @@
+enum E {
+ A = 1,
+ B = 2,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/output.json
new file mode 100644
index 000000000000..862a8bc5691b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumNumberBody",
+ "start": 11,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumNumberMember",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ {
+ "type": "EnumNumberMember",
+ "start": 20,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/input.js
new file mode 100644
index 000000000000..7f4f9cb05bbf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/input.js
@@ -0,0 +1,3 @@
+enum E of number {
+ A,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json
new file mode 100644
index 000000000000..b668cbc42536
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/input.js
new file mode 100644
index 000000000000..a435e44e3da9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/input.js
@@ -0,0 +1,4 @@
+enum E {
+ A,
+ B = 1,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json
new file mode 100644
index 000000000000..b668cbc42536
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/options.json
new file mode 100644
index 000000000000..53fd48c051cb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/options.json
@@ -0,0 +1,3 @@
+{
+ "plugins": [["flow", { "enums": true }]]
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/input.js
new file mode 100644
index 000000000000..95350dba2f86
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/input.js
@@ -0,0 +1,2 @@
+enum class {
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json
new file mode 100644
index 000000000000..50d57cc99e4d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "Unexpected keyword 'class' (1:5)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/input.js
new file mode 100644
index 000000000000..0d3f7fed8378
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/input.js
@@ -0,0 +1,4 @@
+enum E of string {
+ A,
+ B,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/output.json
new file mode 100644
index 000000000000..57cc928ec552
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/output.json
@@ -0,0 +1,149 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 21,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "explicitType": true,
+ "members": [
+ {
+ "type": "EnumDefaultedMember",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ }
+ },
+ {
+ "type": "EnumDefaultedMember",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/input.js
new file mode 100644
index 000000000000..4d27120ac56a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/input.js
@@ -0,0 +1,4 @@
+enum E of string {
+ A = "a",
+ B = "b",
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/output.json
new file mode 100644
index 000000000000..1ab361d41977
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 21,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "explicitType": true,
+ "members": [
+ {
+ "type": "EnumStringMember",
+ "start": 21,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "StringLiteral",
+ "start": 25,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": "a",
+ "raw": "\"a\""
+ },
+ "value": "a"
+ }
+ },
+ {
+ "type": "EnumStringMember",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "StringLiteral",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": "b",
+ "raw": "\"b\""
+ },
+ "value": "b"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/input.js
new file mode 100644
index 000000000000..b74648fd612c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/input.js
@@ -0,0 +1,4 @@
+enum E {
+ A,
+ B,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/output.json
new file mode 100644
index 000000000000..b14d096085c2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/output.json
@@ -0,0 +1,149 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 11,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumDefaultedMember",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ }
+ },
+ {
+ "type": "EnumDefaultedMember",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/input.js
new file mode 100644
index 000000000000..d1b1c29fc8a8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/input.js
@@ -0,0 +1,4 @@
+enum E {
+ A = "a",
+ B = "b",
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/output.json
new file mode 100644
index 000000000000..8f3e4e6eb48a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 11,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumStringMember",
+ "start": 11,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "StringLiteral",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": "a",
+ "raw": "\"a\""
+ },
+ "value": "a"
+ }
+ },
+ {
+ "type": "EnumStringMember",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "StringLiteral",
+ "start": 26,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": "b",
+ "raw": "\"b\""
+ },
+ "value": "b"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/input.js
new file mode 100644
index 000000000000..279605f466c4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/input.js
@@ -0,0 +1,5 @@
+enum E of string {
+ A = "a",
+ B,
+ C,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json
new file mode 100644
index 000000000000..71e396752a2e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/input.js
new file mode 100644
index 000000000000..e8db50effe4d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/input.js
@@ -0,0 +1,5 @@
+enum E of string {
+ A,
+ B = "b",
+ C = "c",
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json
new file mode 100644
index 000000000000..71e396752a2e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["flow", { "enums": true }]],
+ "throws": "String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/input.js b/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/input.js
new file mode 100644
index 000000000000..26e5377f5e71
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/input.js
@@ -0,0 +1,4 @@
+enum E of symbol {
+ A,
+ B,
+}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json
new file mode 100644
index 000000000000..6f5ba3e152c1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json
@@ -0,0 +1,148 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumSymbolBody",
+ "start": 21,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "members": [
+ {
+ "type": "EnumDefaultedMember",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ }
+ },
+ {
+ "type": "EnumDefaultedMember",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/options.json b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/options.json
index 51aa897d2c31..ee996d3cfc6f 100644
--- a/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/options.json
+++ b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/options.json
@@ -1,6 +1,6 @@
{
"plugins": [
"transform-typescript",
- [ "proposal-decorators", { "legacy": true } ]
+ ["proposal-decorators", { "legacy": true }]
]
}
diff --git a/packages/babel-plugin-syntax-flow/src/index.js b/packages/babel-plugin-syntax-flow/src/index.js
index 0062dbee50e6..72fb7dc60b95 100644
--- a/packages/babel-plugin-syntax-flow/src/index.js
+++ b/packages/babel-plugin-syntax-flow/src/index.js
@@ -5,12 +5,16 @@ export default declare((api, options) => {
// When enabled and plugins includes flow, all files should be parsed as if
// the @flow pragma was provided.
- const { all } = options;
+ const { all, enums } = options;
if (typeof all !== "boolean" && typeof all !== "undefined") {
throw new Error(".all must be a boolean, or undefined");
}
+ if (typeof enums !== "boolean" && typeof enums !== "undefined") {
+ throw new Error(".enums must be a boolean, or undefined");
+ }
+
return {
name: "syntax-flow",
@@ -25,7 +29,7 @@ export default declare((api, options) => {
return;
}
- parserOpts.plugins.push(["flow", { all }]);
+ parserOpts.plugins.push(["flow", { all, enums }]);
},
};
});
diff --git a/packages/babel-types/src/asserts/generated/index.js b/packages/babel-types/src/asserts/generated/index.js
index 60a91b88178d..4fb0fd754a15 100644
--- a/packages/babel-types/src/asserts/generated/index.js
+++ b/packages/babel-types/src/asserts/generated/index.js
@@ -584,6 +584,39 @@ export function assertVoidTypeAnnotation(
): void {
assert("VoidTypeAnnotation", node, opts);
}
+export function assertEnumDeclaration(node: Object, opts?: Object = {}): void {
+ assert("EnumDeclaration", node, opts);
+}
+export function assertEnumBooleanBody(node: Object, opts?: Object = {}): void {
+ assert("EnumBooleanBody", node, opts);
+}
+export function assertEnumNumberBody(node: Object, opts?: Object = {}): void {
+ assert("EnumNumberBody", node, opts);
+}
+export function assertEnumStringBody(node: Object, opts?: Object = {}): void {
+ assert("EnumStringBody", node, opts);
+}
+export function assertEnumSymbolBody(node: Object, opts?: Object = {}): void {
+ assert("EnumSymbolBody", node, opts);
+}
+export function assertEnumBooleanMember(
+ node: Object,
+ opts?: Object = {},
+): void {
+ assert("EnumBooleanMember", node, opts);
+}
+export function assertEnumNumberMember(node: Object, opts?: Object = {}): void {
+ assert("EnumNumberMember", node, opts);
+}
+export function assertEnumStringMember(node: Object, opts?: Object = {}): void {
+ assert("EnumStringMember", node, opts);
+}
+export function assertEnumDefaultedMember(
+ node: Object,
+ opts?: Object = {},
+): void {
+ assert("EnumDefaultedMember", node, opts);
+}
export function assertJSXAttribute(node: Object, opts?: Object = {}): void {
assert("JSXAttribute", node, opts);
}
@@ -1139,6 +1172,12 @@ export function assertFlowDeclaration(node: Object, opts?: Object = {}): void {
export function assertFlowPredicate(node: Object, opts?: Object = {}): void {
assert("FlowPredicate", node, opts);
}
+export function assertEnumBody(node: Object, opts?: Object = {}): void {
+ assert("EnumBody", node, opts);
+}
+export function assertEnumMember(node: Object, opts?: Object = {}): void {
+ assert("EnumMember", node, opts);
+}
export function assertJSX(node: Object, opts?: Object = {}): void {
assert("JSX", node, opts);
}
diff --git a/packages/babel-types/src/builders/generated/index.js b/packages/babel-types/src/builders/generated/index.js
index 2cb9d5490c9d..fe7f320d028a 100644
--- a/packages/babel-types/src/builders/generated/index.js
+++ b/packages/babel-types/src/builders/generated/index.js
@@ -517,6 +517,42 @@ export function VoidTypeAnnotation(...args: Array): Object {
return builder("VoidTypeAnnotation", ...args);
}
export { VoidTypeAnnotation as voidTypeAnnotation };
+export function EnumDeclaration(...args: Array): Object {
+ return builder("EnumDeclaration", ...args);
+}
+export { EnumDeclaration as enumDeclaration };
+export function EnumBooleanBody(...args: Array): Object {
+ return builder("EnumBooleanBody", ...args);
+}
+export { EnumBooleanBody as enumBooleanBody };
+export function EnumNumberBody(...args: Array): Object {
+ return builder("EnumNumberBody", ...args);
+}
+export { EnumNumberBody as enumNumberBody };
+export function EnumStringBody(...args: Array): Object {
+ return builder("EnumStringBody", ...args);
+}
+export { EnumStringBody as enumStringBody };
+export function EnumSymbolBody(...args: Array): Object {
+ return builder("EnumSymbolBody", ...args);
+}
+export { EnumSymbolBody as enumSymbolBody };
+export function EnumBooleanMember(...args: Array): Object {
+ return builder("EnumBooleanMember", ...args);
+}
+export { EnumBooleanMember as enumBooleanMember };
+export function EnumNumberMember(...args: Array): Object {
+ return builder("EnumNumberMember", ...args);
+}
+export { EnumNumberMember as enumNumberMember };
+export function EnumStringMember(...args: Array): Object {
+ return builder("EnumStringMember", ...args);
+}
+export { EnumStringMember as enumStringMember };
+export function EnumDefaultedMember(...args: Array): Object {
+ return builder("EnumDefaultedMember", ...args);
+}
+export { EnumDefaultedMember as enumDefaultedMember };
export function JSXAttribute(...args: Array): Object {
return builder("JSXAttribute", ...args);
}
diff --git a/packages/babel-types/src/constants/generated/index.js b/packages/babel-types/src/constants/generated/index.js
index eedb7038ed28..1f4b576a87b6 100644
--- a/packages/babel-types/src/constants/generated/index.js
+++ b/packages/babel-types/src/constants/generated/index.js
@@ -45,6 +45,8 @@ export const FLOWBASEANNOTATION_TYPES =
FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
export const FLOWDECLARATION_TYPES = FLIPPED_ALIAS_KEYS["FlowDeclaration"];
export const FLOWPREDICATE_TYPES = FLIPPED_ALIAS_KEYS["FlowPredicate"];
+export const ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS["EnumBody"];
+export const ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS["EnumMember"];
export const JSX_TYPES = FLIPPED_ALIAS_KEYS["JSX"];
export const PRIVATE_TYPES = FLIPPED_ALIAS_KEYS["Private"];
export const TSTYPEELEMENT_TYPES = FLIPPED_ALIAS_KEYS["TSTypeElement"];
diff --git a/packages/babel-types/src/definitions/flow.js b/packages/babel-types/src/definitions/flow.js
index 75f6c8801966..68560582605f 100644
--- a/packages/babel-types/src/definitions/flow.js
+++ b/packages/babel-types/src/definitions/flow.js
@@ -4,6 +4,7 @@ import defineType, {
assertOneOf,
assertValueType,
validate,
+ validateArrayOfType,
validateOptional,
validateOptionalType,
validateType,
@@ -464,3 +465,88 @@ defineType("Variance", {
defineType("VoidTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"],
});
+
+// Enums
+defineType("EnumDeclaration", {
+ alises: ["Declaration"],
+ visitor: ["id", "body"],
+ fields: {
+ id: validateType("Identifier"),
+ body: validateType([
+ "EnumBooleanBody",
+ "EnumNumberBody",
+ "EnumStringBody",
+ "EnumSymbolBody",
+ ]),
+ },
+});
+
+defineType("EnumBooleanBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: validate(assertValueType("boolean")),
+ members: validateArrayOfType("EnumBooleanMember"),
+ },
+});
+
+defineType("EnumNumberBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: validate(assertValueType("boolean")),
+ members: validateArrayOfType("EnumNumberMember"),
+ },
+});
+
+defineType("EnumStringBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: validate(assertValueType("boolean")),
+ members: validateArrayOfType(["EnumStringMember", "EnumDefaultedMember"]),
+ },
+});
+
+defineType("EnumSymbolBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ members: validateArrayOfType("EnumDefaultedMember"),
+ },
+});
+
+defineType("EnumBooleanMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: validateType("Identifier"),
+ init: validateType("BooleanLiteral"),
+ },
+});
+
+defineType("EnumNumberMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: validateType("Identifier"),
+ init: validateType("NumericLiteral"),
+ },
+});
+
+defineType("EnumStringMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: validateType("Identifier"),
+ init: validateType("StringLiteral"),
+ },
+});
+
+defineType("EnumDefaultedMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: validateType("Identifier"),
+ },
+});
diff --git a/packages/babel-types/src/validators/generated/index.js b/packages/babel-types/src/validators/generated/index.js
index 84f44ef882cd..13ac0be73ac4 100644
--- a/packages/babel-types/src/validators/generated/index.js
+++ b/packages/babel-types/src/validators/generated/index.js
@@ -1866,6 +1866,132 @@ export function isVoidTypeAnnotation(node: ?Object, opts?: Object): boolean {
return false;
}
+export function isEnumDeclaration(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumBooleanBody(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumBooleanBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumNumberBody(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumNumberBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumStringBody(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumStringBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumSymbolBody(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumSymbolBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumBooleanMember(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumBooleanMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumNumberMember(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumNumberMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumStringMember(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumStringMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumDefaultedMember(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (nodeType === "EnumDefaultedMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
export function isJSXAttribute(node: ?Object, opts?: Object): boolean {
if (!node) return false;
@@ -4276,6 +4402,46 @@ export function isFlowPredicate(node: ?Object, opts?: Object): boolean {
return false;
}
+export function isEnumBody(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (
+ nodeType === "EnumBody" ||
+ "EnumBooleanBody" === nodeType ||
+ "EnumNumberBody" === nodeType ||
+ "EnumStringBody" === nodeType ||
+ "EnumSymbolBody" === nodeType
+ ) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
+export function isEnumMember(node: ?Object, opts?: Object): boolean {
+ if (!node) return false;
+
+ const nodeType = node.type;
+ if (
+ nodeType === "EnumMember" ||
+ "EnumBooleanMember" === nodeType ||
+ "EnumNumberMember" === nodeType ||
+ "EnumStringMember" === nodeType ||
+ "EnumDefaultedMember" === nodeType
+ ) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+}
export function isJSX(node: ?Object, opts?: Object): boolean {
if (!node) return false;
From 8ffca0475a82ac577907529ba225a96460b112fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Tue, 29 Oct 2019 17:58:04 -0400
Subject: [PATCH 023/648] Merge multiple regex transform plugin (#10447)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat: implement create-regexp-features-plugin
* fix: test input is not effective
* refactor: leverage create-regexp-features-plugin
* test: add more test cases
* test: update test fixture
* chore: add type annotation to features
* test: add regression test for issue 9892
* add regression test for issue 9199
* address review comments from Nicolò
* address review comments from Brian
* small tweaks
* Enable dotAllFlag when flags includes u
---
.../.npmignore | 3 +
.../README.md | 19 ++++
.../package.json | 31 ++++++
.../src/features.js | 27 ++++++
.../src/index.js | 96 +++++++++++++++++++
.../src/util.js | 56 +++++++++++
.../input.mjs | 1 +
.../options.json | 6 ++
.../output.mjs | 1 +
.../runtime-false-not-overwritten/input.mjs | 1 +
.../options.json | 6 ++
.../runtime-false-not-overwritten/output.mjs | 1 +
.../test/index.js | 3 +
.../package.json | 5 +-
.../src/index.js | 26 ++---
.../with-unicode-flag/unicode-12/input.js | 2 +-
.../package.json | 8 +-
.../src/index.js | 23 +----
.../with-unicode-property-escape/input.js | 2 +
.../with-unicode-property-escape/options.json | 3 +
.../with-unicode-property-escape/output.js | 2 +
.../package.json | 2 +-
.../src/index.js | 55 ++---------
.../test/fixtures/runtime/issue-10601/exec.js | 7 ++
.../fixtures/runtime/issue-10601/options.json | 3 +
.../looks-like-a-group-unicode/input.js | 1 +
.../looks-like-a-group-unicode/options.json | 7 ++
.../looks-like-a-group-unicode/output.js | 1 +
.../wrapper/looks-like-a-group/output.js | 2 +-
.../package.json | 5 +-
.../src/index.js | 17 +---
.../plugins-integration/issue-8951/exec.js | 3 +
.../issue-8951/options.json | 4 +
.../plugins-integration/issue-9892/exec.js | 1 +
.../issue-9892/options.json | 4 +
.../unicode-property-regex-chrome-49/input.js | 1 +
.../options.json | 10 ++
.../output.js | 1 +
38 files changed, 333 insertions(+), 113 deletions(-)
create mode 100644 packages/babel-helper-create-regexp-features-plugin/.npmignore
create mode 100644 packages/babel-helper-create-regexp-features-plugin/README.md
create mode 100644 packages/babel-helper-create-regexp-features-plugin/package.json
create mode 100644 packages/babel-helper-create-regexp-features-plugin/src/features.js
create mode 100644 packages/babel-helper-create-regexp-features-plugin/src/index.js
create mode 100644 packages/babel-helper-create-regexp-features-plugin/src/util.js
create mode 100644 packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/input.mjs
create mode 100644 packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/options.json
create mode 100644 packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/output.mjs
create mode 100644 packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/input.mjs
create mode 100644 packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/options.json
create mode 100644 packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/output.mjs
create mode 100644 packages/babel-helper-create-regexp-features-plugin/test/index.js
create mode 100644 packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/input.js
create mode 100644 packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/options.json
create mode 100644 packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/output.js
create mode 100644 packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10601/exec.js
create mode 100644 packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10601/options.json
create mode 100644 packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/input.js
create mode 100644 packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/options.json
create mode 100644 packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/output.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-8951/exec.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-8951/options.json
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-9892/exec.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-9892/options.json
create mode 100644 packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/input.js
create mode 100644 packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/options.json
create mode 100644 packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/output.js
diff --git a/packages/babel-helper-create-regexp-features-plugin/.npmignore b/packages/babel-helper-create-regexp-features-plugin/.npmignore
new file mode 100644
index 000000000000..f9806945836e
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/.npmignore
@@ -0,0 +1,3 @@
+src
+test
+*.log
diff --git a/packages/babel-helper-create-regexp-features-plugin/README.md b/packages/babel-helper-create-regexp-features-plugin/README.md
new file mode 100644
index 000000000000..69f661bd987e
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/README.md
@@ -0,0 +1,19 @@
+# @babel/helper-create-regexp-features-plugin
+
+> Compile ESNext Regular Expressions to ES5
+
+See our website [@babel/helper-create-regexp-features-plugin](https://babeljs.io/docs/en/next/babel-helper-create-regexp-features-plugin.html) for more information.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save-dev @babel/helper-create-regexp-features-plugin
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/helper-create-regexp-features-plugin --dev
+```
diff --git a/packages/babel-helper-create-regexp-features-plugin/package.json b/packages/babel-helper-create-regexp-features-plugin/package.json
new file mode 100644
index 000000000000..7d49d45d507b
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "@babel/helper-create-regexp-features-plugin",
+ "version": "7.6.0",
+ "author": "The Babel Team (https://babeljs.io/team)",
+ "license": "MIT",
+ "description": "Compile ESNext Regular Expressions to ES5",
+ "repository": {
+ "type": "git",
+ "repository": "https://github.com/babel/babel",
+ "directory": "packages/babel-helper-create-regexp-features-plugin"
+ },
+ "main": "lib/index.js",
+ "publishConfig": {
+ "access": "public"
+ },
+ "keywords": [
+ "babel",
+ "babel-plugin"
+ ],
+ "dependencies": {
+ "@babel/helper-regex": "^7.4.4",
+ "regexpu-core": "^4.6.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.6.0",
+ "@babel/helper-plugin-test-runner": "^7.0.0"
+ }
+}
diff --git a/packages/babel-helper-create-regexp-features-plugin/src/features.js b/packages/babel-helper-create-regexp-features-plugin/src/features.js
new file mode 100644
index 000000000000..8e82b1342e88
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/src/features.js
@@ -0,0 +1,27 @@
+// @flow
+export const FEATURES = Object.freeze({
+ unicodeFlag: 1 << 0,
+ dotAllFlag: 1 << 1,
+ unicodePropertyEscape: 1 << 2,
+ namedCaptureGroups: 1 << 3,
+});
+
+// We can't use a symbol because this needs to always be the same, even if
+// this package isn't deduped by npm. e.g.
+// - node_modules/
+// - @babel/plugin-regexp-features
+// - @babel/plugin-proposal-unicode-property-regex
+// - node_modules
+// - @babel-plugin-regexp-features
+export const featuresKey = "@babel/plugin-regexp-features/featuresKey";
+export const runtimeKey = "@babel/plugin-regexp-features/runtimeKey";
+
+type FeatureType = $Values;
+
+export function enableFeature(features: number, feature: FeatureType): number {
+ return features | feature;
+}
+
+export function hasFeature(features: number, feature: FeatureType) {
+ return !!(features & feature);
+}
diff --git a/packages/babel-helper-create-regexp-features-plugin/src/index.js b/packages/babel-helper-create-regexp-features-plugin/src/index.js
new file mode 100644
index 000000000000..49554be42ad2
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/src/index.js
@@ -0,0 +1,96 @@
+import rewritePattern from "regexpu-core";
+import {
+ featuresKey,
+ FEATURES,
+ enableFeature,
+ runtimeKey,
+ hasFeature,
+} from "./features";
+import { generateRegexpuOptions } from "./util";
+
+import pkg from "../package.json";
+import { types as t } from "@babel/core";
+import { pullFlag } from "@babel/helper-regex";
+
+// Note: Versions are represented as an integer. e.g. 7.1.5 is represented
+// as 70000100005. This method is easier than using a semver-parsing
+// package, but it breaks if we release x.y.z where x, y or z are
+// greater than 99_999.
+const version = pkg.version.split(".").reduce((v, x) => v * 1e5 + +x, 0);
+const versionKey = "@babel/plugin-regexp-features/version";
+
+export function createRegExpFeaturePlugin({ name, feature, options = {} }) {
+ return {
+ name,
+ pre() {
+ const { file } = this;
+ const features = file.get(featuresKey) ?? 0;
+ let newFeatures = enableFeature(features, FEATURES[feature]);
+
+ const { useUnicodeFlag, runtime = true } = options;
+ if (useUnicodeFlag === false) {
+ newFeatures = enableFeature(newFeatures, FEATURES.unicodeFlag);
+ }
+ if (newFeatures !== features) {
+ file.set(featuresKey, newFeatures);
+ }
+
+ if (!runtime) {
+ file.set(runtimeKey, false);
+ }
+
+ if (!file.has(versionKey) || file.get(versionKey) < version) {
+ file.set(versionKey, version);
+ }
+ },
+
+ visitor: {
+ RegExpLiteral(path) {
+ const { node } = path;
+ const { file } = this;
+ const features = file.get(featuresKey);
+ const runtime = file.get(runtimeKey) ?? true;
+ const regexpuOptions = generateRegexpuOptions(node, features);
+ if (regexpuOptions === null) {
+ return;
+ }
+ const namedCaptureGroups = {};
+ if (regexpuOptions.namedGroup) {
+ regexpuOptions.onNamedGroup = (name, index) => {
+ namedCaptureGroups[name] = index;
+ };
+ }
+ node.pattern = rewritePattern(node.pattern, node.flags, regexpuOptions);
+
+ if (
+ regexpuOptions.namedGroup &&
+ Object.keys(namedCaptureGroups).length > 0 &&
+ runtime &&
+ !isRegExpTest(path)
+ ) {
+ path.replaceWith(
+ t.callExpression(this.addHelper("wrapRegExp"), [
+ node,
+ t.valueToNode(namedCaptureGroups),
+ ]),
+ );
+ }
+ if (hasFeature(features, FEATURES.unicodeFlag)) {
+ pullFlag(node, "u");
+ }
+ if (hasFeature(features, FEATURES.dotAllFlag)) {
+ pullFlag(node, "s");
+ }
+ },
+ },
+ };
+}
+
+function isRegExpTest(path) {
+ return (
+ path.parentPath.isMemberExpression({
+ object: path.node,
+ computed: false,
+ }) && path.parentPath.get("property").isIdentifier({ name: "test" })
+ );
+}
diff --git a/packages/babel-helper-create-regexp-features-plugin/src/util.js b/packages/babel-helper-create-regexp-features-plugin/src/util.js
new file mode 100644
index 000000000000..bc6f89dcebce
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/src/util.js
@@ -0,0 +1,56 @@
+import { FEATURES, hasFeature } from "./features";
+
+export function generateRegexpuOptions(node, features) {
+ let useUnicodeFlag = false,
+ dotAllFlag = false,
+ unicodePropertyEscape = false,
+ namedGroup = false;
+ const { flags, pattern } = node;
+ const flagsIncludesU = flags.includes("u");
+
+ if (flagsIncludesU) {
+ if (!hasFeature(features, FEATURES.unicodeFlag)) {
+ useUnicodeFlag = true;
+ }
+ if (
+ hasFeature(features, FEATURES.unicodePropertyEscape) &&
+ /\\[pP]{/.test(pattern)
+ ) {
+ unicodePropertyEscape = true;
+ }
+ }
+
+ if (hasFeature(features, FEATURES.dotAllFlag) && flags.indexOf("s") >= 0) {
+ dotAllFlag = true;
+ }
+ if (
+ hasFeature(features, FEATURES.namedCaptureGroups) &&
+ /\(\?<(?![=!])/.test(pattern)
+ ) {
+ namedGroup = true;
+ }
+ if (
+ !namedGroup &&
+ !unicodePropertyEscape &&
+ !dotAllFlag &&
+ (!flagsIncludesU || useUnicodeFlag)
+ ) {
+ return null;
+ }
+ // Now we have to feed regexpu-core the regex
+ if (flagsIncludesU && flags.indexOf("s") >= 0) {
+ // When flags includes u, `config.unicode` will be enabled even if `u` is supported natively.
+ // In this case we have to enable dotAllFlag, otherwise `rewritePattern(/./su)` will return
+ // incorrect result
+ // https://github.com/mathiasbynens/regexpu-core/blob/v4.6.0/rewrite-pattern.js#L191
+ dotAllFlag = true;
+ }
+ return {
+ useUnicodeFlag,
+ onNamedGroup: () => {},
+ namedGroup,
+ unicodePropertyEscape,
+ dotAllFlag,
+ lookbehind: true,
+ };
+}
diff --git a/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/input.mjs b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/input.mjs
new file mode 100644
index 000000000000..f972b98245a9
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/input.mjs
@@ -0,0 +1 @@
+/\p{Script_Extensions=Wancho}/u
diff --git a/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/options.json b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/options.json
new file mode 100644
index 000000000000..d1c7bd8740ad
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/options.json
@@ -0,0 +1,6 @@
+{
+ "plugins": [
+ ["proposal-unicode-property-regex", { "useUnicodeFlag": false }, "name 1"],
+ ["proposal-unicode-property-regex", { "useUnicodeFlag": true }, "name 2"]
+ ]
+}
diff --git a/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/output.mjs b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/output.mjs
new file mode 100644
index 000000000000..f43a80b8405b
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-proposal-unicode-property-regex/use-unicode-flag-false-not-overwritten/output.mjs
@@ -0,0 +1 @@
+/(?:\uD838[\uDEC0-\uDEF9\uDEFF])/;
diff --git a/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/input.mjs b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/input.mjs
new file mode 100644
index 000000000000..3d7f5b1517b5
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/input.mjs
@@ -0,0 +1 @@
+/(?\d{4})/
diff --git a/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/options.json b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/options.json
new file mode 100644
index 000000000000..ca279789330b
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/options.json
@@ -0,0 +1,6 @@
+{
+ "plugins": [
+ ["transform-named-capturing-groups-regex", { "runtime": false }, "name 1"],
+ ["transform-named-capturing-groups-regex", { "runtime": true }, "name 2"]
+ ]
+}
diff --git a/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/output.mjs b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/output.mjs
new file mode 100644
index 000000000000..f47a50b38088
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/test/fixtures/plugin-transform-named-capturing-groups-regex/runtime-false-not-overwritten/output.mjs
@@ -0,0 +1 @@
+/([0-9]{4})/;
diff --git a/packages/babel-helper-create-regexp-features-plugin/test/index.js b/packages/babel-helper-create-regexp-features-plugin/test/index.js
new file mode 100644
index 000000000000..1b534b8fc64a
--- /dev/null
+++ b/packages/babel-helper-create-regexp-features-plugin/test/index.js
@@ -0,0 +1,3 @@
+import runner from "@babel/helper-plugin-test-runner";
+
+runner(__dirname);
diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json
index 2fe4510857d1..cfb844aeb1bc 100644
--- a/packages/babel-plugin-proposal-unicode-property-regex/package.json
+++ b/packages/babel-plugin-proposal-unicode-property-regex/package.json
@@ -22,9 +22,8 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-unicode-property-regex",
"bugs": "https://github.com/babel/babel/issues",
"dependencies": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.4.4",
- "regexpu-core": "^4.6.0"
+ "@babel/helper-create-regexp-features-plugin": "^7.6.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
diff --git a/packages/babel-plugin-proposal-unicode-property-regex/src/index.js b/packages/babel-plugin-proposal-unicode-property-regex/src/index.js
index b0245892311f..bf76031cbf12 100644
--- a/packages/babel-plugin-proposal-unicode-property-regex/src/index.js
+++ b/packages/babel-plugin-proposal-unicode-property-regex/src/index.js
@@ -1,6 +1,6 @@
+/* eslint-disable @babel/development/plugin-name */
+import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-plugin";
import { declare } from "@babel/helper-plugin-utils";
-import rewritePattern from "regexpu-core";
-import * as regex from "@babel/helper-regex";
export default declare((api, options) => {
api.assertVersion(7);
@@ -10,23 +10,9 @@ export default declare((api, options) => {
throw new Error(".useUnicodeFlag must be a boolean, or undefined");
}
- return {
+ return createRegExpFeaturePlugin({
name: "proposal-unicode-property-regex",
-
- visitor: {
- RegExpLiteral(path) {
- const node = path.node;
- if (!regex.is(node, "u")) {
- return;
- }
- node.pattern = rewritePattern(node.pattern, node.flags, {
- unicodePropertyEscape: true,
- useUnicodeFlag,
- });
- if (!useUnicodeFlag) {
- regex.pullFlag(node, "u");
- }
- },
- },
- };
+ feature: "unicodePropertyEscape",
+ options: { useUnicodeFlag },
+ });
});
diff --git a/packages/babel-plugin-proposal-unicode-property-regex/test/fixtures/with-unicode-flag/unicode-12/input.js b/packages/babel-plugin-proposal-unicode-property-regex/test/fixtures/with-unicode-flag/unicode-12/input.js
index 711dde943b3c..e50ab9eb68e0 100644
--- a/packages/babel-plugin-proposal-unicode-property-regex/test/fixtures/with-unicode-flag/unicode-12/input.js
+++ b/packages/babel-plugin-proposal-unicode-property-regex/test/fixtures/with-unicode-flag/unicode-12/input.js
@@ -1 +1 @@
-var regex = /[\u{1E2C0}-\u{1E2F9}\u{1E2FF}]/u;
+var regex = /[\p{Script_Extensions=Wancho}]/u;
diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json
index 106ce8056802..4ace562398ab 100644
--- a/packages/babel-plugin-transform-dotall-regex/package.json
+++ b/packages/babel-plugin-transform-dotall-regex/package.json
@@ -8,9 +8,6 @@
"access": "public"
},
"main": "lib/index.js",
- "engines": {
- "node": ">=4"
- },
"keywords": [
"babel-plugin",
"regex",
@@ -21,9 +18,8 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-dotall-regex",
"bugs": "https://github.com/babel/babel/issues",
"dependencies": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.4.4",
- "regexpu-core": "^4.6.0"
+ "@babel/helper-create-regexp-features-plugin": "^7.6.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
diff --git a/packages/babel-plugin-transform-dotall-regex/src/index.js b/packages/babel-plugin-transform-dotall-regex/src/index.js
index af11660ea05e..a41961076922 100644
--- a/packages/babel-plugin-transform-dotall-regex/src/index.js
+++ b/packages/babel-plugin-transform-dotall-regex/src/index.js
@@ -1,25 +1,12 @@
+/* eslint-disable @babel/development/plugin-name */
+import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-plugin";
import { declare } from "@babel/helper-plugin-utils";
-import rewritePattern from "regexpu-core";
-import * as regex from "@babel/helper-regex";
export default declare(api => {
api.assertVersion(7);
- return {
+ return createRegExpFeaturePlugin({
name: "transform-dotall-regex",
-
- visitor: {
- RegExpLiteral(path) {
- const node = path.node;
- if (!regex.is(node, "s")) {
- return;
- }
- node.pattern = rewritePattern(node.pattern, node.flags, {
- dotAllFlag: true,
- useUnicodeFlag: regex.is(node, "u"),
- });
- regex.pullFlag(node, "s");
- },
- },
- };
+ feature: "dotAllFlag",
+ });
});
diff --git a/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/input.js b/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/input.js
new file mode 100644
index 000000000000..dc74dbc0d615
--- /dev/null
+++ b/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/input.js
@@ -0,0 +1,2 @@
+var a = /\p{Unified_Ideograph}./u;
+var b = /\p{Unified_Ideograph}./su;
diff --git a/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/options.json b/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/options.json
new file mode 100644
index 000000000000..2078653dce15
--- /dev/null
+++ b/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/options.json
@@ -0,0 +1,3 @@
+{
+ "plugins": ["transform-dotall-regex", "proposal-unicode-property-regex"]
+}
diff --git a/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/output.js b/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/output.js
new file mode 100644
index 000000000000..a8ddf757d926
--- /dev/null
+++ b/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/with-unicode-property-escape/output.js
@@ -0,0 +1,2 @@
+var a = /[\u3400-\u4DB5\u4E00-\u9FEF\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29\u{20000}-\u{2A6D6}\u{2A700}-\u{2B734}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}][\0-\t\x0B\f\x0E-\u2027\u202A-\u{10FFFF}]/u;
+var b = /[\u3400-\u4DB5\u4E00-\u9FEF\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29\u{20000}-\u{2A6D6}\u{2A700}-\u{2B734}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}][\0-\u{10FFFF}]/u;
diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json
index 679aa4396f52..3d1b894fc89a 100644
--- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json
+++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json
@@ -21,7 +21,7 @@
},
"bugs": "https://github.com/babel/babel/issues",
"dependencies": {
- "regexpu-core": "^4.6.0"
+ "@babel/helper-create-regexp-features-plugin": "^7.6.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/src/index.js b/packages/babel-plugin-transform-named-capturing-groups-regex/src/index.js
index 148da9e99a55..2cc0193310fd 100644
--- a/packages/babel-plugin-transform-named-capturing-groups-regex/src/index.js
+++ b/packages/babel-plugin-transform-named-capturing-groups-regex/src/index.js
@@ -1,56 +1,15 @@
-import rewritePattern from "regexpu-core";
+/* eslint-disable @babel/development/plugin-name */
+import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-plugin";
-export default function({ types: t }, options) {
+export default function(core, options) {
const { runtime = true } = options;
if (typeof runtime !== "boolean") {
throw new Error("The 'runtime' option must be boolean");
}
- return {
+ return createRegExpFeaturePlugin({
name: "transform-named-capturing-groups-regex",
-
- visitor: {
- RegExpLiteral(path) {
- const node = path.node;
- if (!/\(\?<(?![=!])/.test(node.pattern)) {
- // Return early if there are no named groups.
- // The .indexOf check may have false positives (e.g. /\(?); in
- // this case we parse the regex and regexp-tree won't transform it.
- return;
- }
-
- const namedCapturingGroups = {};
- const result = rewritePattern(node.pattern, node.flags, {
- namedGroup: true,
- //todo: consider refactor `lookbehind` true as modular plugin
- lookbehind: true,
- onNamedGroup(name, index) {
- namedCapturingGroups[name] = index;
- },
- });
-
- if (Object.keys(namedCapturingGroups).length > 0) {
- node.pattern = result;
-
- if (runtime && !isRegExpTest(path)) {
- path.replaceWith(
- t.callExpression(this.addHelper("wrapRegExp"), [
- node,
- t.valueToNode(namedCapturingGroups),
- ]),
- );
- }
- }
- },
- },
- };
-}
-
-function isRegExpTest(path) {
- return (
- path.parentPath.isMemberExpression({
- object: path.node,
- computed: false,
- }) && path.parentPath.get("property").isIdentifier({ name: "test" })
- );
+ feature: "namedCaptureGroups",
+ options: { runtime },
+ });
}
diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10601/exec.js b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10601/exec.js
new file mode 100644
index 000000000000..21136a48f1ac
--- /dev/null
+++ b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10601/exec.js
@@ -0,0 +1,7 @@
+const regex = /<(?\d)+>.*?<\/\k>/su;
+
+const result = regex.exec('<0>xxx\nyyy0>');
+
+expect(result.groups).toEqual({
+ tag: "0"
+});
diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10601/options.json b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10601/options.json
new file mode 100644
index 000000000000..2454c2169cf8
--- /dev/null
+++ b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10601/options.json
@@ -0,0 +1,3 @@
+{
+ "minNodeVersion": "8.0.0"
+}
diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/input.js b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/input.js
new file mode 100644
index 000000000000..00a7c78b9344
--- /dev/null
+++ b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/input.js
@@ -0,0 +1 @@
+/no-groups-\(?looks\)\u{10000}/u;
diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/options.json b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/options.json
new file mode 100644
index 000000000000..1832df9cd6ad
--- /dev/null
+++ b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/options.json
@@ -0,0 +1,7 @@
+{
+ "plugins": [
+ ["external-helpers", { "helperVersion": "7.1000.0" }],
+ "transform-named-capturing-groups-regex",
+ "transform-unicode-regex"
+ ]
+}
diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/output.js b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/output.js
new file mode 100644
index 000000000000..af299f8fceaf
--- /dev/null
+++ b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group-unicode/output.js
@@ -0,0 +1 @@
+/no\x2Dgroups\x2D\(?looks\)(?:\uD800\uDC00)/;
diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group/output.js b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group/output.js
index 4c55ef0dbe17..6fe7c2ef533c 100644
--- a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group/output.js
+++ b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/wrapper/looks-like-a-group/output.js
@@ -1 +1 @@
-/no-groups-\(?looks\)/;
+/no\x2Dgroups\x2D\(?looks\)/;
diff --git a/packages/babel-plugin-transform-unicode-regex/package.json b/packages/babel-plugin-transform-unicode-regex/package.json
index a3a534041774..647fb228ce30 100644
--- a/packages/babel-plugin-transform-unicode-regex/package.json
+++ b/packages/babel-plugin-transform-unicode-regex/package.json
@@ -12,9 +12,8 @@
"babel-plugin"
],
"dependencies": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.4.4",
- "regexpu-core": "^4.6.0"
+ "@babel/helper-create-regexp-features-plugin": "^7.6.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
diff --git a/packages/babel-plugin-transform-unicode-regex/src/index.js b/packages/babel-plugin-transform-unicode-regex/src/index.js
index 88593e055917..cfc4cd8a40f2 100644
--- a/packages/babel-plugin-transform-unicode-regex/src/index.js
+++ b/packages/babel-plugin-transform-unicode-regex/src/index.js
@@ -1,19 +1,12 @@
+/* eslint-disable @babel/development/plugin-name */
+import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-plugin";
import { declare } from "@babel/helper-plugin-utils";
-import rewritePattern from "regexpu-core";
-import * as regex from "@babel/helper-regex";
export default declare(api => {
api.assertVersion(7);
- return {
+ return createRegExpFeaturePlugin({
name: "transform-unicode-regex",
-
- visitor: {
- RegExpLiteral({ node }) {
- if (!regex.is(node, "u")) return;
- node.pattern = rewritePattern(node.pattern, node.flags);
- regex.pullFlag(node, "u");
- },
- },
- };
+ feature: "unicodeFlag",
+ });
});
diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-8951/exec.js b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-8951/exec.js
new file mode 100644
index 000000000000..0372fa5d04ee
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-8951/exec.js
@@ -0,0 +1,3 @@
+expect(/.(?\p{ASCII})/su.exec("\nA").groups).toEqual({
+ code: "A"
+});
diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-8951/options.json b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-8951/options.json
new file mode 100644
index 000000000000..26bf537b2805
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-8951/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [],
+ "presets": ["../../../../lib"]
+}
diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9892/exec.js b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9892/exec.js
new file mode 100644
index 000000000000..dad5dc1ba34f
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9892/exec.js
@@ -0,0 +1 @@
+expect(/[\p{L}\d_]+/u.test('ŁŻŹĆ')).toBe(true);
diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9892/options.json b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9892/options.json
new file mode 100644
index 000000000000..26bf537b2805
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9892/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [],
+ "presets": ["../../../../lib"]
+}
diff --git a/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/input.js b/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/input.js
new file mode 100644
index 000000000000..4dc88814e7a9
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/input.js
@@ -0,0 +1 @@
+/\p{Script_Extensions=Greek}/u;
diff --git a/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/options.json b/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/options.json
new file mode 100644
index 000000000000..0594e8b2ce13
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/options.json
@@ -0,0 +1,10 @@
+{
+ "presets": [
+ [
+ "../../../../lib",
+ {
+ "targets": "chrome 49"
+ }
+ ]
+ ]
+}
diff --git a/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/output.js b/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/output.js
new file mode 100644
index 000000000000..ca4cbfc0fb21
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/preset-options/unicode-property-regex-chrome-49/output.js
@@ -0,0 +1 @@
+/(?:[\u0342\u0345\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF-\u1DC1\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65]|\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45])/;
From 3d2f3650745d981127109871b8ffdbd34e28d87c Mon Sep 17 00:00:00 2001
From: Ivan Medina
Date: Tue, 29 Oct 2019 16:02:53 -0600
Subject: [PATCH 024/648] [transform-react-jsx] Add useSpread option to
transform JSX (#10572)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* [transform-react-jsx] Add useSpread option to transform JSX
* Add validation for default option
* Add error when using useSpread and useBuiltIns at the same time
* Move useSpread to convertAttribute helper function
* Add useSpread option to presect-react
* Remove casting useSpread to boolean in preset-react option.
Co-Authored-By: Nicolò Ribaudo
---
.../src/index.js | 24 +++++++++++++++++++
.../assignment-invalid-option/input.js | 1 +
.../assignment-invalid-option/options.json | 4 ++++
.../useSpread/assignment-use-builtin/input.js | 1 +
.../assignment-use-builtin/options.json | 6 +++++
.../fixtures/useSpread/assignment/input.js | 1 +
.../fixtures/useSpread/assignment/output.js | 3 +++
.../test/fixtures/useSpread/options.json | 3 +++
packages/babel-preset-react/src/index.js | 3 ++-
9 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-invalid-option/input.js
create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-invalid-option/options.json
create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-use-builtin/input.js
create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-use-builtin/options.json
create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment/input.js
create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment/output.js
create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/options.json
diff --git a/packages/babel-helper-builder-react-jsx/src/index.js b/packages/babel-helper-builder-react-jsx/src/index.js
index fa68384f1b70..64b136923f45 100644
--- a/packages/babel-helper-builder-react-jsx/src/index.js
+++ b/packages/babel-helper-builder-react-jsx/src/index.js
@@ -87,6 +87,10 @@ You can turn on the 'throwIfNamespace' flag to bypass this warning.`,
function convertAttribute(node) {
const value = convertAttributeValue(node.value || t.booleanLiteral(true));
+ if (t.isJSXSpreadAttribute(node)) {
+ return t.spreadElement(node.argument);
+ }
+
if (t.isStringLiteral(value) && !t.isJSXExpressionContainer(node.value)) {
value.value = value.value.replace(/\n\s+/g, " ");
@@ -170,6 +174,14 @@ You can turn on the 'throwIfNamespace' flag to bypass this warning.`,
let _props = [];
const objs = [];
+ const { useSpread = false } = file.opts;
+ if (typeof useSpread !== "boolean") {
+ throw new Error(
+ "transform-react-jsx currently only accepts a boolean option for " +
+ "useSpread (defaults to false)",
+ );
+ }
+
const useBuiltIns = file.opts.useBuiltIns || false;
if (typeof useBuiltIns !== "boolean") {
throw new Error(
@@ -178,6 +190,18 @@ You can turn on the 'throwIfNamespace' flag to bypass this warning.`,
);
}
+ if (useSpread && useBuiltIns) {
+ throw new Error(
+ "transform-react-jsx currently only accepts useBuiltIns or useSpread " +
+ "but not both",
+ );
+ }
+
+ if (useSpread) {
+ const props = attribs.map(convertAttribute);
+ return t.objectExpression(props);
+ }
+
while (attribs.length) {
const prop = attribs.shift();
if (t.isJSXSpreadAttribute(prop)) {
diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-invalid-option/input.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-invalid-option/input.js
new file mode 100644
index 000000000000..4caacb6aa17d
--- /dev/null
+++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-invalid-option/input.js
@@ -0,0 +1 @@
+var div =
diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-invalid-option/options.json b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-invalid-option/options.json
new file mode 100644
index 000000000000..ff6406c9a4e2
--- /dev/null
+++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-invalid-option/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": [["transform-react-jsx", { "useSpread": 0 }]],
+ "throws": "transform-react-jsx currently only accepts a boolean option for useSpread (defaults to false)"
+}
diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-use-builtin/input.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-use-builtin/input.js
new file mode 100644
index 000000000000..4caacb6aa17d
--- /dev/null
+++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-use-builtin/input.js
@@ -0,0 +1 @@
+var div =
diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-use-builtin/options.json b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-use-builtin/options.json
new file mode 100644
index 000000000000..eab6051daa03
--- /dev/null
+++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment-use-builtin/options.json
@@ -0,0 +1,6 @@
+{
+ "plugins": [
+ ["transform-react-jsx", { "useSpread": true, "useBuiltIns": true }]
+ ],
+ "throws": "transform-react-jsx currently only accepts useBuiltIns or useSpread but not both"
+}
diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment/input.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment/input.js
new file mode 100644
index 000000000000..4caacb6aa17d
--- /dev/null
+++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment/input.js
@@ -0,0 +1 @@
+var div =
diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment/output.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment/output.js
new file mode 100644
index 000000000000..6d3c49132173
--- /dev/null
+++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/assignment/output.js
@@ -0,0 +1,3 @@
+var div = React.createElement(Component, { ...props,
+ foo: "bar"
+});
diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/options.json b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/options.json
new file mode 100644
index 000000000000..7e0d5fcba0f3
--- /dev/null
+++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/useSpread/options.json
@@ -0,0 +1,3 @@
+{
+ "plugins": [["transform-react-jsx", { "useSpread": true }]]
+}
diff --git a/packages/babel-preset-react/src/index.js b/packages/babel-preset-react/src/index.js
index f99fe36e0b1c..aaf358ea5979 100644
--- a/packages/babel-preset-react/src/index.js
+++ b/packages/babel-preset-react/src/index.js
@@ -13,6 +13,7 @@ export default declare((api, opts) => {
opts.throwIfNamespace === undefined ? true : !!opts.throwIfNamespace;
const development = !!opts.development;
const useBuiltIns = !!opts.useBuiltIns;
+ const { useSpread } = opts;
if (typeof development !== "boolean") {
throw new Error(
@@ -24,7 +25,7 @@ export default declare((api, opts) => {
plugins: [
[
transformReactJSX,
- { pragma, pragmaFrag, throwIfNamespace, useBuiltIns },
+ { pragma, pragmaFrag, throwIfNamespace, useBuiltIns, useSpread },
],
transformReactDisplayName,
From 4e6a4b08bba1c46cc4b01d168e300c1408c68076 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Tue, 29 Oct 2019 23:27:56 +0100
Subject: [PATCH 025/648] Create @babel/plugin-syntax-top-level-await (#10573)
---
.../.npmignore | 3 +++
.../README.md | 19 +++++++++++++++
.../package.json | 23 +++++++++++++++++++
.../src/index.js | 13 +++++++++++
packages/babel-preset-env/package.json | 1 +
.../babel-preset-env/src/available-plugins.js | 1 +
packages/babel-preset-env/src/index.js | 12 ++++++++++
.../top-level-await/supported/input.mjs | 1 +
.../top-level-await/supported/options.json | 8 +++++++
.../top-level-await/supported/output.mjs | 1 +
.../top-level-await/unsupported/input.mjs | 1 +
.../top-level-await/unsupported/options.json | 9 ++++++++
12 files changed, 92 insertions(+)
create mode 100644 packages/babel-plugin-syntax-top-level-await/.npmignore
create mode 100644 packages/babel-plugin-syntax-top-level-await/README.md
create mode 100644 packages/babel-plugin-syntax-top-level-await/package.json
create mode 100644 packages/babel-plugin-syntax-top-level-await/src/index.js
create mode 100644 packages/babel-preset-env/test/fixtures/top-level-await/supported/input.mjs
create mode 100644 packages/babel-preset-env/test/fixtures/top-level-await/supported/options.json
create mode 100644 packages/babel-preset-env/test/fixtures/top-level-await/supported/output.mjs
create mode 100644 packages/babel-preset-env/test/fixtures/top-level-await/unsupported/input.mjs
create mode 100644 packages/babel-preset-env/test/fixtures/top-level-await/unsupported/options.json
diff --git a/packages/babel-plugin-syntax-top-level-await/.npmignore b/packages/babel-plugin-syntax-top-level-await/.npmignore
new file mode 100644
index 000000000000..cace0d6ddcdd
--- /dev/null
+++ b/packages/babel-plugin-syntax-top-level-await/.npmignore
@@ -0,0 +1,3 @@
+node_modules
+*.log
+src
diff --git a/packages/babel-plugin-syntax-top-level-await/README.md b/packages/babel-plugin-syntax-top-level-await/README.md
new file mode 100644
index 000000000000..476cb27d6bbb
--- /dev/null
+++ b/packages/babel-plugin-syntax-top-level-await/README.md
@@ -0,0 +1,19 @@
+# @babel/plugin-syntax-top-level-await
+
+> Allow parsing of top-level await in modules
+
+See our website [@babel/plugin-syntax-top-level-await](https://babeljs.io/docs/en/next/babel-plugin-syntax-top-level-await.html) for more information.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save-dev @babel/plugin-syntax-top-level-await
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/plugin-syntax-top-level-await --dev
+```
diff --git a/packages/babel-plugin-syntax-top-level-await/package.json b/packages/babel-plugin-syntax-top-level-await/package.json
new file mode 100644
index 000000000000..8411ce39f938
--- /dev/null
+++ b/packages/babel-plugin-syntax-top-level-await/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "@babel/plugin-syntax-top-level-await",
+ "version": "7.6.4",
+ "description": "Allow parsing of top-level await in modules",
+ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-top-level-await",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "lib/index.js",
+ "keywords": [
+ "babel-plugin"
+ ],
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.4.4"
+ }
+}
diff --git a/packages/babel-plugin-syntax-top-level-await/src/index.js b/packages/babel-plugin-syntax-top-level-await/src/index.js
new file mode 100644
index 000000000000..2429b8ead657
--- /dev/null
+++ b/packages/babel-plugin-syntax-top-level-await/src/index.js
@@ -0,0 +1,13 @@
+import { declare } from "@babel/helper-plugin-utils";
+
+export default declare(api => {
+ api.assertVersion(7);
+
+ return {
+ name: "syntax-top-level-await",
+
+ manipulateOptions(opts, parserOpts) {
+ parserOpts.plugins.push("topLevelAwait");
+ },
+ };
+});
diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json
index 740beedde749..5cfecce86f6b 100644
--- a/packages/babel-preset-env/package.json
+++ b/packages/babel-preset-env/package.json
@@ -27,6 +27,7 @@
"@babel/plugin-syntax-json-strings": "^7.2.0",
"@babel/plugin-syntax-object-rest-spread": "^7.2.0",
"@babel/plugin-syntax-optional-catch-binding": "^7.2.0",
+ "@babel/plugin-syntax-top-level-await": "^7.6.4",
"@babel/plugin-transform-arrow-functions": "^7.2.0",
"@babel/plugin-transform-async-to-generator": "^7.5.0",
"@babel/plugin-transform-block-scoped-functions": "^7.2.0",
diff --git a/packages/babel-preset-env/src/available-plugins.js b/packages/babel-preset-env/src/available-plugins.js
index 77da4ff02cf0..8ce0c72f1aa0 100644
--- a/packages/babel-preset-env/src/available-plugins.js
+++ b/packages/babel-preset-env/src/available-plugins.js
@@ -6,6 +6,7 @@ export default {
"syntax-json-strings": require("@babel/plugin-syntax-json-strings"),
"syntax-object-rest-spread": require("@babel/plugin-syntax-object-rest-spread"),
"syntax-optional-catch-binding": require("@babel/plugin-syntax-optional-catch-binding"),
+ "syntax-top-level-await": require("@babel/plugin-syntax-top-level-await"),
"transform-async-to-generator": require("@babel/plugin-transform-async-to-generator"),
"proposal-async-generator-functions": require("@babel/plugin-proposal-async-generator-functions"),
"proposal-dynamic-import": require("@babel/plugin-proposal-dynamic-import"),
diff --git a/packages/babel-preset-env/src/index.js b/packages/babel-preset-env/src/index.js
index 76f11ebcb934..b1d335e5527a 100644
--- a/packages/babel-preset-env/src/index.js
+++ b/packages/babel-preset-env/src/index.js
@@ -65,11 +65,13 @@ export const getModulesPluginNames = ({
transformations,
shouldTransformESM,
shouldTransformDynamicImport,
+ shouldParseTopLevelAwait,
}: {
modules: ModuleOption,
transformations: ModuleTransformationsType,
shouldTransformESM: boolean,
shouldTransformDynamicImport: boolean,
+ shouldParseTopLevelAwait: boolean,
}) => {
const modulesPluginNames = [];
if (modules !== false && transformations[modules]) {
@@ -95,6 +97,11 @@ export const getModulesPluginNames = ({
} else {
modulesPluginNames.push("syntax-dynamic-import");
}
+
+ if (shouldParseTopLevelAwait) {
+ modulesPluginNames.push("syntax-top-level-await");
+ }
+
return modulesPluginNames;
};
@@ -165,6 +172,10 @@ function supportsDynamicImport(caller) {
return !!(caller && caller.supportsDynamicImport);
}
+function supportsTopLevelAwait(caller) {
+ return !!(caller && caller.supportsTopLevelAwait);
+}
+
export default declare((api, opts) => {
api.assertVersion(7);
@@ -225,6 +236,7 @@ export default declare((api, opts) => {
modules !== "auto" || !api.caller || !api.caller(supportsStaticESM),
shouldTransformDynamicImport:
modules !== "auto" || !api.caller || !api.caller(supportsDynamicImport),
+ shouldParseTopLevelAwait: api.caller(supportsTopLevelAwait),
});
const pluginNames = filterItems(
diff --git a/packages/babel-preset-env/test/fixtures/top-level-await/supported/input.mjs b/packages/babel-preset-env/test/fixtures/top-level-await/supported/input.mjs
new file mode 100644
index 000000000000..d8ddd6c0ad0b
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/top-level-await/supported/input.mjs
@@ -0,0 +1 @@
+await 0;
\ No newline at end of file
diff --git a/packages/babel-preset-env/test/fixtures/top-level-await/supported/options.json b/packages/babel-preset-env/test/fixtures/top-level-await/supported/options.json
new file mode 100644
index 000000000000..9307569540d9
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/top-level-await/supported/options.json
@@ -0,0 +1,8 @@
+{
+ "caller": {
+ "name": "test-fixture",
+ "supportsStaticESM": true,
+ "supportsTopLevelAwait": true
+ },
+ "presets": ["env"]
+}
diff --git a/packages/babel-preset-env/test/fixtures/top-level-await/supported/output.mjs b/packages/babel-preset-env/test/fixtures/top-level-await/supported/output.mjs
new file mode 100644
index 000000000000..0a5e432fc91c
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/top-level-await/supported/output.mjs
@@ -0,0 +1 @@
+await 0;
diff --git a/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/input.mjs b/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/input.mjs
new file mode 100644
index 000000000000..d8ddd6c0ad0b
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/input.mjs
@@ -0,0 +1 @@
+await 0;
\ No newline at end of file
diff --git a/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/options.json b/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/options.json
new file mode 100644
index 000000000000..65ac70b9a5f7
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/options.json
@@ -0,0 +1,9 @@
+{
+ "caller": {
+ "name": "test-fixture",
+ "supportsStaticESM": true,
+ "supportsTopLevelAwait": false
+ },
+ "presets": ["env"],
+ "throws": "Can not use keyword 'await' outside an async function (1:0)"
+}
From e419e5fe42eba840738a78115a84584b24468f67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Tue, 29 Oct 2019 19:19:16 -0400
Subject: [PATCH 026/648] chore: bump source-map-support to 0.5.14 (#10614)
---
packages/babel-register/package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json
index 466ba1d54523..3c5f11fa6f77 100644
--- a/packages/babel-register/package.json
+++ b/packages/babel-register/package.json
@@ -17,7 +17,7 @@
"lodash": "^4.17.13",
"make-dir": "^2.1.0",
"pirates": "^4.0.0",
- "source-map-support": "^0.5.9"
+ "source-map-support": "^0.5.14"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
From 0b0edc3e3d1f4bf07f19b7023f776e7e6ac45407 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?=
Date: Wed, 30 Oct 2019 12:56:52 +0100
Subject: [PATCH 027/648] chore: bump source-map-support to 0.5.16 (#10615)
---
packages/babel-register/package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json
index 3c5f11fa6f77..397c70c64f87 100644
--- a/packages/babel-register/package.json
+++ b/packages/babel-register/package.json
@@ -17,7 +17,7 @@
"lodash": "^4.17.13",
"make-dir": "^2.1.0",
"pirates": "^4.0.0",
- "source-map-support": "^0.5.14"
+ "source-map-support": "^0.5.16"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
From a2b5437b012e47b63d3517bc784b5108f3fb9c9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Thu, 31 Oct 2019 14:51:36 -0400
Subject: [PATCH 028/648] chore: remove output-file-sync dependency (#10619)
---
packages/babel-cli/package.json | 1 -
packages/babel-cli/src/babel/dir.js | 6 +++++-
packages/babel-cli/test/index.js | 7 ++++++-
packages/babel-node/package.json | 2 +-
packages/babel-node/test/index.js | 7 ++++++-
5 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json
index 7e8de8bcb9c9..843c7c3c8787 100644
--- a/packages/babel-cli/package.json
+++ b/packages/babel-cli/package.json
@@ -25,7 +25,6 @@
"glob": "^7.0.0",
"lodash": "^4.17.13",
"make-dir": "^2.1.0",
- "output-file-sync": "^2.0.0",
"slash": "^2.0.0",
"source-map": "^0.5.0"
},
diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js
index 094f7806f90a..c6790d5acea7 100644
--- a/packages/babel-cli/src/babel/dir.js
+++ b/packages/babel-cli/src/babel/dir.js
@@ -1,7 +1,6 @@
// @flow
import defaults from "lodash/defaults";
-import outputFileSync from "output-file-sync";
import { sync as makeDirSync } from "make-dir";
import slash from "slash";
import path from "path";
@@ -10,6 +9,11 @@ import fs from "fs";
import * as util from "./util";
import { type CmdOptions } from "./options";
+function outputFileSync(filePath: string, data: string | Buffer): void {
+ makeDirSync(path.dirname(filePath));
+ fs.writeFileSync(filePath, data);
+}
+
export default async function({
cliOptions,
babelOptions,
diff --git a/packages/babel-cli/test/index.js b/packages/babel-cli/test/index.js
index 7aa457b00fb8..88d596740133 100644
--- a/packages/babel-cli/test/index.js
+++ b/packages/babel-cli/test/index.js
@@ -1,7 +1,7 @@
const readdir = require("fs-readdir-recursive");
const helper = require("@babel/helper-fixtures");
const rimraf = require("rimraf");
-const outputFileSync = require("output-file-sync");
+const { sync: makeDirSync } = require("make-dir");
const child = require("child_process");
const merge = require("lodash/merge");
const path = require("path");
@@ -14,6 +14,11 @@ const fileFilter = function(x) {
return x !== ".DS_Store";
};
+const outputFileSync = function(filePath, data) {
+ makeDirSync(path.dirname(filePath));
+ fs.writeFileSync(filePath, data);
+};
+
const presetLocs = [path.join(__dirname, "../../babel-preset-react")];
const pluginLocs = [
diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json
index f2b77567c4fb..737f8eadf884 100644
--- a/packages/babel-node/package.json
+++ b/packages/babel-node/package.json
@@ -34,7 +34,7 @@
"@babel/core": "^7.6.3",
"@babel/helper-fixtures": "^7.6.3",
"fs-readdir-recursive": "^1.0.0",
- "output-file-sync": "^2.0.0"
+ "make-dir": "^2.1.0"
},
"bin": {
"babel-node": "./bin/babel-node.js"
diff --git a/packages/babel-node/test/index.js b/packages/babel-node/test/index.js
index 45283de76957..97ee54c02450 100644
--- a/packages/babel-node/test/index.js
+++ b/packages/babel-node/test/index.js
@@ -2,7 +2,7 @@ const includes = require("lodash/includes");
const readdir = require("fs-readdir-recursive");
const helper = require("@babel/helper-fixtures");
const rimraf = require("rimraf");
-const outputFileSync = require("output-file-sync");
+const { sync: makeDirSync } = require("make-dir");
const child = require("child_process");
const merge = require("lodash/merge");
const path = require("path");
@@ -15,6 +15,11 @@ const fileFilter = function(x) {
return x !== ".DS_Store";
};
+const outputFileSync = function(filePath, data) {
+ makeDirSync(path.dirname(filePath));
+ fs.writeFileSync(filePath, data);
+};
+
const presetLocs = [
path.join(__dirname, "../../babel-preset-env"),
path.join(__dirname, "../../babel-preset-react"),
From d08702c9d2b2880e2a9adc922a491e046bdda831 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Thu, 31 Oct 2019 16:12:44 -0400
Subject: [PATCH 029/648] inputSourceMap should work when it is in an external
file (#10623)
* fix: construct comment block for fromMapFileComment
* add test
* small tweak: redundant capturing group
---
packages/babel-core/src/transformation/normalize-file.js | 5 +++--
.../source-maps/input-source-map-external/input.js | 5 +++++
.../source-maps/input-source-map-external/input.js.map | 1 +
.../source-maps/input-source-map-external/options.json | 3 +++
.../source-maps/input-source-map-external/output.js | 3 +++
.../source-maps/input-source-map-external/source-map.json | 7 +++++++
6 files changed, 22 insertions(+), 2 deletions(-)
create mode 100644 packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/input.js
create mode 100644 packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/input.js.map
create mode 100644 packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/options.json
create mode 100644 packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/output.js
create mode 100644 packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/source-map.json
diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js
index 6326dd385e66..cc7db60a5478 100644
--- a/packages/babel-core/src/transformation/normalize-file.js
+++ b/packages/babel-core/src/transformation/normalize-file.js
@@ -65,7 +65,8 @@ export default function normalizeFile(
if (typeof options.filename === "string" && lastComment) {
try {
inputMap = convertSourceMap.fromMapFileComment(
- lastComment,
+ // fromMapFileComment requires the whole comment block
+ `//${lastComment}`,
path.dirname(options.filename),
);
} catch (err) {
@@ -156,7 +157,7 @@ function parser(
// eslint-disable-next-line max-len
const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
-const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$/;
+const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=(?:[^\s'"`]+?)[ \t]*$/;
function extractCommentsFromList(regex, comments, lastComment) {
if (comments) {
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/input.js b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/input.js
new file mode 100644
index 000000000000..f7250b67d0b4
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/input.js
@@ -0,0 +1,5 @@
+var foo = function () {
+ return 4;
+};
+
+//# sourceMappingURL=input.js.map
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/input.js.map b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/input.js.map
new file mode 100644
index 000000000000..cb88961ebdc0
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/input.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["original.js"],"names":[],"mappings":"AAAA,UAAU,Y;SAAM,C;CAAC","sourcesContent":["var foo = () => 4;"]}
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/options.json b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/options.json
new file mode 100644
index 000000000000..0e6084f210d8
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/options.json
@@ -0,0 +1,3 @@
+{
+ "inputSourceMap": true
+}
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/output.js b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/output.js
new file mode 100644
index 000000000000..cf3efeceb306
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/output.js
@@ -0,0 +1,3 @@
+var foo = function () {
+ return 4;
+};
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/source-map.json b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/source-map.json
new file mode 100644
index 000000000000..63c01db5fede
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-external/source-map.json
@@ -0,0 +1,7 @@
+{
+ "mappings": "AAAA,IAAA,GAAA,GAAU,Y;SAAM,C;AAAC,CAAjB",
+ "names": [],
+ "sources": ["original.js"],
+ "sourcesContent": ["var foo = () => 4;"],
+ "version": 3
+}
From c7d8b8a37752f42163128cf4d5e8b54c2637cec4 Mon Sep 17 00:00:00 2001
From: Martin Forsgren
Date: Sat, 2 Nov 2019 12:04:16 +0100
Subject: [PATCH 030/648] throw a TypeError if identifier validation fails
(#10621)
* throw a TypeError if Identifier validation fails
* Relax identifier validation, reserved words are ok
---
packages/babel-types/src/definitions/core.js | 6 +++---
packages/babel-types/src/index.js | 1 +
packages/babel-types/src/validators/isIdentifierName.js | 9 +++++++++
3 files changed, 13 insertions(+), 3 deletions(-)
create mode 100644 packages/babel-types/src/validators/isIdentifierName.js
diff --git a/packages/babel-types/src/definitions/core.js b/packages/babel-types/src/definitions/core.js
index 09c41c9119a9..2b7802096cd9 100644
--- a/packages/babel-types/src/definitions/core.js
+++ b/packages/babel-types/src/definitions/core.js
@@ -1,5 +1,5 @@
// @flow
-import isValidIdentifier from "../validators/isValidIdentifier";
+import isIdentifierName from "../validators/isIdentifierName";
import {
BINARY_OPERATORS,
@@ -406,8 +406,8 @@ defineType("Identifier", {
...patternLikeCommon,
name: {
validate: chain(function(node, key, val) {
- if (!isValidIdentifier(val)) {
- // throw new TypeError(`"${val}" is not a valid identifer name`);
+ if (!isIdentifierName(val)) {
+ throw new TypeError(`"${val}" is not a valid identifer name`);
}
}, assertValueType("string")),
},
diff --git a/packages/babel-types/src/index.js b/packages/babel-types/src/index.js
index d3311dfc9f2f..a34588c85c06 100644
--- a/packages/babel-types/src/index.js
+++ b/packages/babel-types/src/index.js
@@ -109,6 +109,7 @@ export {
default as isValidES3Identifier,
} from "./validators/isValidES3Identifier";
export { default as isValidIdentifier } from "./validators/isValidIdentifier";
+export { default as isIdentifierName } from "./validators/isIdentifierName";
export { default as isVar } from "./validators/isVar";
export { default as matchesPattern } from "./validators/matchesPattern";
export { default as validate } from "./validators/validate";
diff --git a/packages/babel-types/src/validators/isIdentifierName.js b/packages/babel-types/src/validators/isIdentifierName.js
new file mode 100644
index 000000000000..9cae809217cf
--- /dev/null
+++ b/packages/babel-types/src/validators/isIdentifierName.js
@@ -0,0 +1,9 @@
+// @flow
+import esutils from "esutils";
+
+/**
+ * Check if the input `name` is a valid identifier name.
+ */
+export default function isIdentifierName(name: string): boolean {
+ return esutils.keyword.isIdentifierNameES6(name);
+}
From 58a646be595115d5cf80d6a252d0f6c51c7022ac Mon Sep 17 00:00:00 2001
From: Mohammad Ahmadi
Date: Mon, 4 Nov 2019 02:54:00 +0330
Subject: [PATCH 031/648] corrected the grammar of option descriptions (#10589)
* corrected the grammar of option descriptions
* added comment
---
packages/babel-cli/src/babel/options.js | 57 +++++++++++++------------
1 file changed, 29 insertions(+), 28 deletions(-)
diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js
index 9425c510b451..04a648c1fd5a 100644
--- a/packages/babel-cli/src/babel/options.js
+++ b/packages/babel-cli/src/babel/options.js
@@ -12,19 +12,19 @@ import pkg from "../../package.json";
// Standard Babel input configs.
commander.option(
"-f, --filename [filename]",
- "filename to use when reading from stdin - this will be used in source-maps, errors etc",
+ "The filename to use when reading from stdin. This will be used in source-maps, errors etc.",
);
commander.option(
"--presets [list]",
- "comma-separated list of preset names",
+ "A comma-separated list of preset names.",
collect,
);
commander.option(
"--plugins [list]",
- "comma-separated list of plugin names",
+ "A comma-separated list of plugin names.",
collect,
);
-commander.option("--config-file [path]", "Path to a .babelrc file to use");
+commander.option("--config-file [path]", "Path to a .babelrc file to use.");
commander.option(
"--env-name [name]",
"The name of the 'env' to use when loading configs and plugins. " +
@@ -40,97 +40,98 @@ commander.option(
commander.option("--source-type [script|module]", "");
commander.option(
"--no-babelrc",
- "Whether or not to look up .babelrc and .babelignore files",
+ "Whether or not to look up .babelrc and .babelignore files.",
);
commander.option(
"--ignore [list]",
- "list of glob paths to **not** compile",
+ "List of glob paths to **not** compile.",
collect,
);
commander.option(
"--only [list]",
- "list of glob paths to **only** compile",
+ "List of glob paths to **only** compile.",
collect,
);
// Misc babel config.
commander.option(
"--no-highlight-code",
- "enable/disable ANSI syntax highlighting of code frames (on by default)",
+ "Enable or disable ANSI syntax highlighting of code frames. (on by default)",
);
// General output formatting.
commander.option(
"--no-comments",
- "write comments to generated output (true by default)",
+ "Write comments to generated output. (true by default)",
);
commander.option(
"--retain-lines",
- "retain line numbers - will result in really ugly code",
+ "Retain line numbers. This will result in really ugly code.",
);
commander.option(
"--compact [true|false|auto]",
- "do not include superfluous whitespace characters and line terminators",
+ "Do not include superfluous whitespace characters and line terminators.",
booleanify,
);
commander.option("--minified", "save as much bytes when printing [true|false]");
commander.option(
"--auxiliary-comment-before [string]",
- "print a comment before any injected non-user code",
+ "Print a comment before any injected non-user code.",
);
commander.option(
"--auxiliary-comment-after [string]",
- "print a comment after any injected non-user code",
+ "Print a comment after any injected non-user code.",
);
// General source map formatting.
commander.option("-s, --source-maps [true|false|inline|both]", "", booleanify);
commander.option(
"--source-map-target [string]",
- "set `file` on returned source map",
+ "Set `file` on returned source map.",
);
commander.option(
"--source-file-name [string]",
- "set `sources[0]` on returned source map",
+ "Set `sources[0]` on returned source map.",
);
commander.option(
"--source-root [filename]",
- "the root from which all sources are relative",
+ "The root from which all sources are relative.",
);
// Config params for certain module output formats.
commander.option(
"--module-root [filename]",
- "optional prefix for the AMD module formatter that will be prepend to the filename on module definitions",
+ // eslint-disable-next-line max-len
+ "Optional prefix for the AMD module formatter that will be prepended to the filename on module definitions.",
);
-commander.option("-M, --module-ids", "insert an explicit id for modules");
+commander.option("-M, --module-ids", "Insert an explicit id for modules.");
commander.option(
"--module-id [string]",
- "specify a custom name for module ids",
+ "Specify a custom name for module ids.",
);
// "babel" command specific arguments that are not passed to @babel/core.
commander.option(
"-x, --extensions [extensions]",
- "List of extensions to compile when a directory has been input [.es6,.js,.es,.jsx,.mjs]",
+ "List of extensions to compile when a directory has been the input. [.es6,.js,.es,.jsx,.mjs]",
collect,
);
commander.option(
"--keep-file-extension",
- "Preserve the file extensions of the input files",
+ "Preserve the file extensions of the input files.",
);
-commander.option("-w, --watch", "Recompile files on changes");
+commander.option("-w, --watch", "Recompile files on changes.");
commander.option(
"--skip-initial-build",
- "Do not compile files before watching",
+ "Do not compile files before watching.",
);
commander.option(
"-o, --out-file [out]",
- "Compile all input files into a single file",
+ "Compile all input files into a single file.",
);
commander.option(
"-d, --out-dir [out]",
- "Compile an input directory of modules into an output directory",
+ "Compile an input directory of modules into an output directory.",
);
commander.option(
"--relative",
@@ -138,11 +139,11 @@ commander.option(
);
commander.option(
"-D, --copy-files",
- "When compiling a directory copy over non-compilable files",
+ "When compiling a directory copy over non-compilable files.",
);
commander.option(
"--include-dotfiles",
- "Include dotfiles when compiling and copying non-compilable files",
+ "Include dotfiles when compiling and copying non-compilable files.",
);
commander.option(
"--verbose",
@@ -154,7 +155,7 @@ commander.option(
);
commander.option(
"--delete-dir-on-start",
- "Delete the out directory before compilation",
+ "Delete the out directory before compilation.",
);
commander.version(pkg.version + " (@babel/core " + version + ")");
From bea1b0d0af7ebe09df2d98dfbaff561d57e7dfe9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Mon, 4 Nov 2019 00:24:44 +0100
Subject: [PATCH 032/648] Add support for .cjs config files (#10599)
* Remove duplicate config loading logic and errors
* Add support for .cjs config files
* Add tests
* [tests] Fallback for fs.promises on node 6
---
.../src/config/files/configuration.js | 108 +++----
packages/babel-core/test/config-chain.js | 281 ++++++++++--------
.../.babelrc} | 2 +-
.../.babelrc.cjs} | 0
.../.babelrc.js} | 0
.../babel.config.cjs} | 2 +-
.../config-files-templates/babel.config.js | 3 +
.../babel.config.json | 0
.../package.json | 0
.../babelrc-cjs-error/.babelrc.cjs | 3 +
.../config/config-files/babelrc/.babelrc | 3 -
.../config/config-files/both-babelrc/.babelrc | 1 -
.../config-files/both-babelrc/.babelrc.js | 1 -
.../config-files/pkg-babelrc-js/.babelrc.js | 1 -
.../config-files/pkg-babelrc-js/package.json | 3 -
.../config/config-files/pkg-babelrc/.babelrc | 1 -
.../config-files/pkg-babelrc/package.json | 3 -
17 files changed, 198 insertions(+), 214 deletions(-)
rename packages/babel-core/test/fixtures/config/{config-files/babel-config-json/babel.config.json => config-files-templates/.babelrc} (91%)
rename packages/babel-core/test/fixtures/config/{config-files/babel-config-js-and-json/babel.config.js => config-files-templates/.babelrc.cjs} (100%)
rename packages/babel-core/test/fixtures/config/{config-files/babel-config-js/babel.config.js => config-files-templates/.babelrc.js} (100%)
rename packages/babel-core/test/fixtures/config/{config-files/babelrc-js/.babelrc.js => config-files-templates/babel.config.cjs} (55%)
create mode 100644 packages/babel-core/test/fixtures/config/config-files-templates/babel.config.js
rename packages/babel-core/test/fixtures/config/{config-files/babel-config-js-and-json => config-files-templates}/babel.config.json (100%)
rename packages/babel-core/test/fixtures/config/{config-files/pkg => config-files-templates}/package.json (100%)
create mode 100644 packages/babel-core/test/fixtures/config/config-files/babelrc-cjs-error/.babelrc.cjs
delete mode 100644 packages/babel-core/test/fixtures/config/config-files/babelrc/.babelrc
delete mode 100644 packages/babel-core/test/fixtures/config/config-files/both-babelrc/.babelrc
delete mode 100644 packages/babel-core/test/fixtures/config/config-files/both-babelrc/.babelrc.js
delete mode 100644 packages/babel-core/test/fixtures/config/config-files/pkg-babelrc-js/.babelrc.js
delete mode 100644 packages/babel-core/test/fixtures/config/config-files/pkg-babelrc-js/package.json
delete mode 100644 packages/babel-core/test/fixtures/config/config-files/pkg-babelrc/.babelrc
delete mode 100644 packages/babel-core/test/fixtures/config/config-files/pkg-babelrc/package.json
diff --git a/packages/babel-core/src/config/files/configuration.js b/packages/babel-core/src/config/files/configuration.js
index adf26e6c687f..515171ceba94 100644
--- a/packages/babel-core/src/config/files/configuration.js
+++ b/packages/babel-core/src/config/files/configuration.js
@@ -18,26 +18,22 @@ import type { CallerMetadata } from "../validation/options";
const debug = buildDebug("babel:config:loading:files:configuration");
-const BABEL_CONFIG_JS_FILENAME = "babel.config.js";
-const BABEL_CONFIG_JSON_FILENAME = "babel.config.json";
const ROOT_CONFIG_FILENAMES = [
- BABEL_CONFIG_JS_FILENAME,
- BABEL_CONFIG_JSON_FILENAME,
+ "babel.config.js",
+ "babel.config.cjs",
+ "babel.config.json",
];
+const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs"];
-const BABELRC_FILENAME = ".babelrc";
-const BABELRC_JS_FILENAME = ".babelrc.js";
const BABELIGNORE_FILENAME = ".babelignore";
export function findConfigUpwards(rootDir: string): string | null {
let dirname = rootDir;
while (true) {
- if (
- fs.existsSync(path.join(dirname, BABEL_CONFIG_JS_FILENAME)) ||
- fs.existsSync(path.join(dirname, BABEL_CONFIG_JSON_FILENAME))
- ) {
- return dirname;
- }
+ const configFileFound = ROOT_CONFIG_FILENAMES.some(filename =>
+ fs.existsSync(path.join(dirname, filename)),
+ );
+ if (configFileFound) return dirname;
const nextDir = path.dirname(dirname);
if (dirname === nextDir) break;
@@ -59,45 +55,15 @@ export function findRelativeConfig(
for (const loc of packageData.directories) {
if (!config) {
- config = [BABELRC_FILENAME, BABELRC_JS_FILENAME].reduce(
- (previousConfig: ConfigFile | null, name) => {
- const filepath = path.join(loc, name);
- const config = readConfig(filepath, envName, caller);
-
- if (config && previousConfig) {
- throw new Error(
- `Multiple configuration files found. Please remove one:\n` +
- ` - ${path.basename(previousConfig.filepath)}\n` +
- ` - ${name}\n` +
- `from ${loc}`,
- );
- }
-
- return config || previousConfig;
- },
- null,
- );
-
- const pkgConfig =
+ config = loadOneConfig(
+ RELATIVE_CONFIG_FILENAMES,
+ loc,
+ envName,
+ caller,
packageData.pkg && packageData.pkg.dirname === loc
? packageToBabelConfig(packageData.pkg)
- : null;
-
- if (pkgConfig) {
- if (config) {
- throw new Error(
- `Multiple configuration files found. Please remove one:\n` +
- ` - ${path.basename(pkgConfig.filepath)}#babel\n` +
- ` - ${path.basename(config.filepath)}\n` +
- `from ${loc}`,
- );
- }
- config = pkgConfig;
- }
-
- if (config) {
- debug("Found configuration %o from %o.", config.filepath, dirname);
- }
+ : null,
+ );
}
if (!ignore) {
@@ -118,24 +84,31 @@ export function findRootConfig(
envName: string,
caller: CallerMetadata | void,
): ConfigFile | null {
- const config = ROOT_CONFIG_FILENAMES.reduce(
- (previousConfig: ConfigFile | null, name) => {
- const filepath = path.resolve(dirname, name);
- const config = readConfig(filepath, envName, caller);
-
- if (config && previousConfig) {
- throw new Error(
- `Multiple configuration files found. Please remove one:\n` +
- ` - ${path.basename(previousConfig.filepath)}\n` +
- ` - ${name}\n` +
- `from ${dirname}`,
- );
- }
+ return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);
+}
+
+function loadOneConfig(
+ names: string[],
+ dirname: string,
+ envName: string,
+ caller: CallerMetadata | void,
+ previousConfig?: ConfigFile | null = null,
+): ConfigFile | null {
+ const config = names.reduce((previousConfig: ConfigFile | null, name) => {
+ const filepath = path.resolve(dirname, name);
+ const config = readConfig(filepath, envName, caller);
+
+ if (config && previousConfig) {
+ throw new Error(
+ `Multiple configuration files found. Please remove one:\n` +
+ ` - ${path.basename(previousConfig.filepath)}\n` +
+ ` - ${name}\n` +
+ `from ${dirname}`,
+ );
+ }
- return config || previousConfig;
- },
- null,
- );
+ return config || previousConfig;
+ }, previousConfig);
if (config) {
debug("Found configuration %o from %o.", config.filepath, dirname);
@@ -165,7 +138,8 @@ export function loadConfig(
* throw if there are parsing errors while loading a config.
*/
function readConfig(filepath, envName, caller): ConfigFile | null {
- return path.extname(filepath) === ".js"
+ const ext = path.extname(filepath);
+ return ext === ".js" || ext === ".cjs"
? readConfigJS(filepath, { envName, caller })
: readConfigJSON5(filepath);
}
diff --git a/packages/babel-core/test/config-chain.js b/packages/babel-core/test/config-chain.js
index c5f6e2ebf205..078cd91dce97 100644
--- a/packages/babel-core/test/config-chain.js
+++ b/packages/babel-core/test/config-chain.js
@@ -1,8 +1,44 @@
import fs from "fs";
+import os from "os";
import path from "path";
import escapeRegExp from "lodash/escapeRegExp";
import { loadOptions as loadOptionsOrig } from "../lib";
+// TODO: In Babel 8, we can directly uses fs.promises which is supported by
+// node 8+
+const pfs =
+ fs.promises ??
+ new Proxy(fs, {
+ get(target, name) {
+ if (name === "copyFile") {
+ // fs.copyFile is only supported since node 8.5
+ // https://stackoverflow.com/a/30405105/2359289
+ return function copyFile(source, target) {
+ const rd = fs.createReadStream(source);
+ const wr = fs.createWriteStream(target);
+ return new Promise(function(resolve, reject) {
+ rd.on("error", reject);
+ wr.on("error", reject);
+ wr.on("finish", resolve);
+ rd.pipe(wr);
+ }).catch(function(error) {
+ rd.destroy();
+ wr.end();
+ throw error;
+ });
+ };
+ }
+
+ return (...args) =>
+ new Promise((resolve, reject) =>
+ target[name](...args, (error, result) => {
+ if (error) reject(error);
+ else resolve(result);
+ }),
+ );
+ },
+ });
+
function fixture(...args) {
return path.join(__dirname, "fixtures", "config", ...args);
}
@@ -14,6 +50,24 @@ function loadOptions(opts) {
});
}
+function pairs(items) {
+ const pairs = [];
+ for (let i = 0; i < items.length - 1; i++) {
+ for (let j = i + 1; j < items.length; j++) {
+ pairs.push([items[i], items[j]]);
+ }
+ }
+ return pairs;
+}
+
+async function getTemp(name) {
+ const cwd = await pfs.mkdtemp(os.tmpdir() + path.sep + name);
+ const tmp = name => path.join(cwd, name);
+ const config = name =>
+ pfs.copyFile(fixture("config-files-templates", name), tmp(name));
+ return { cwd, tmp, config };
+}
+
describe("buildConfigChain", function() {
describe("test", () => {
describe("single", () => {
@@ -944,157 +998,120 @@ describe("buildConfigChain", function() {
}
});
- it("should load babel.config.json", () => {
- const filename = fixture("config-files", "babel-config-json", "src.js");
+ describe("root", () => {
+ test.each(["babel.config.json", "babel.config.js", "babel.config.cjs"])(
+ "should load %s",
+ async name => {
+ const { cwd, tmp, config } = await getTemp(
+ `babel-test-load-config-${name}`,
+ );
+ const filename = tmp("src.js");
+
+ await config(name);
+
+ expect(
+ loadOptions({
+ filename,
+ cwd,
+ }),
+ ).toEqual({
+ ...getDefaults(),
+ filename,
+ cwd,
+ root: cwd,
+ comments: true,
+ });
+ },
+ );
- expect(
- loadOptions({
- filename,
- cwd: path.dirname(filename),
- }),
- ).toEqual({
- ...getDefaults(),
- filename: filename,
- cwd: path.dirname(filename),
- root: path.dirname(filename),
- comments: true,
- });
- });
+ test.each(
+ pairs(["babel.config.json", "babel.config.js", "babel.config.cjs"]),
+ )("should throw if both %s and %s are used", async (name1, name2) => {
+ const { cwd, tmp, config } = await getTemp(
+ `babel-test-dup-config-${name1}-${name2}`,
+ );
- it("should load babel.config.js", () => {
- const filename = fixture("config-files", "babel-config-js", "src.js");
+ await Promise.all([config(name1), config(name2)]);
- expect(
- loadOptions({
- filename,
- cwd: path.dirname(filename),
- }),
- ).toEqual({
- ...getDefaults(),
- filename: filename,
- cwd: path.dirname(filename),
- root: path.dirname(filename),
- comments: true,
+ expect(() => loadOptions({ filename: tmp("src.js"), cwd })).toThrow(
+ /Multiple configuration files found/,
+ );
});
});
- it("should whtow if both babel.config.json and babel.config.js are used", () => {
- const filename = fixture(
- "config-files",
- "babel-config-js-and-json",
- "src.js",
+ describe("relative", () => {
+ test.each(["package.json", ".babelrc", ".babelrc.js", ".babelrc.cjs"])(
+ "should load %s",
+ async name => {
+ const { cwd, tmp, config } = await getTemp(
+ `babel-test-load-config-${name}`,
+ );
+ const filename = tmp("src.js");
+
+ await config(name);
+
+ expect(
+ loadOptions({
+ filename,
+ cwd,
+ }),
+ ).toEqual({
+ ...getDefaults(),
+ filename,
+ cwd,
+ root: cwd,
+ comments: true,
+ });
+ },
);
- expect(() =>
- loadOptions({ filename, cwd: path.dirname(filename) }),
- ).toThrow(/Multiple configuration files found/);
- });
-
- it("should load .babelrc", () => {
- const filename = fixture("config-files", "babelrc", "src.js");
+ it("should load .babelignore", () => {
+ const filename = fixture("config-files", "babelignore", "src.js");
- expect(
- loadOptions({
- filename,
- cwd: path.dirname(filename),
- }),
- ).toEqual({
- ...getDefaults(),
- filename: filename,
- cwd: path.dirname(filename),
- root: path.dirname(filename),
- comments: true,
+ expect(
+ loadOptions({ filename, cwd: path.dirname(filename) }),
+ ).toBeNull();
});
- });
-
- it("should load .babelrc.js", () => {
- const filename = fixture("config-files", "babelrc-js", "src.js");
- expect(loadOptions({ filename, cwd: path.dirname(filename) })).toEqual({
- ...getDefaults(),
- filename: filename,
- cwd: path.dirname(filename),
- root: path.dirname(filename),
- comments: true,
- });
- });
+ test.each(
+ pairs(["package.json", ".babelrc", ".babelrc.js", ".babelrc.cjs"]),
+ )("should throw if both %s and %s are used", async (name1, name2) => {
+ const { cwd, tmp, config } = await getTemp(
+ `babel-test-dup-config-${name1}-${name2}`,
+ );
- it("should load package.json#babel", () => {
- const filename = fixture("config-files", "pkg", "src.js");
+ await Promise.all([config(name1), config(name2)]);
- expect(loadOptions({ filename, cwd: path.dirname(filename) })).toEqual({
- ...getDefaults(),
- filename: filename,
- cwd: path.dirname(filename),
- root: path.dirname(filename),
- comments: true,
+ expect(() => loadOptions({ filename: tmp("src.js"), cwd })).toThrow(
+ /Multiple configuration files found/,
+ );
});
- });
-
- it("should load .babelignore", () => {
- const filename = fixture("config-files", "babelignore", "src.js");
-
- expect(loadOptions({ filename, cwd: path.dirname(filename) })).toBeNull();
- });
-
- it("should throw if there are both .babelrc and .babelrc.js", () => {
- const filename = fixture("config-files", "both-babelrc", "src.js");
-
- expect(() =>
- loadOptions({ filename, cwd: path.dirname(filename) }),
- ).toThrow(/Multiple configuration files found/);
- });
-
- it("should throw if there are both .babelrc and package.json", () => {
- const filename = fixture("config-files", "pkg-babelrc", "src.js");
-
- expect(() =>
- loadOptions({ filename, cwd: path.dirname(filename) }),
- ).toThrow(/Multiple configuration files found/);
- });
- it("should throw if there are both .babelrc.js and package.json", () => {
- const filename = fixture("config-files", "pkg-babelrc-js", "src.js");
+ it("should ignore package.json without a 'babel' property", () => {
+ const filename = fixture("config-files", "pkg-ignored", "src.js");
- expect(() =>
- loadOptions({ filename, cwd: path.dirname(filename) }),
- ).toThrow(/Multiple configuration files found/);
- });
-
- it("should ignore package.json without a 'babel' property", () => {
- const filename = fixture("config-files", "pkg-ignored", "src.js");
-
- expect(loadOptions({ filename, cwd: path.dirname(filename) })).toEqual({
- ...getDefaults(),
- filename: filename,
- cwd: path.dirname(filename),
- root: path.dirname(filename),
- comments: true,
+ expect(loadOptions({ filename, cwd: path.dirname(filename) })).toEqual({
+ ...getDefaults(),
+ filename: filename,
+ cwd: path.dirname(filename),
+ root: path.dirname(filename),
+ comments: true,
+ });
});
- });
- it("should show helpful errors for .babelrc", () => {
- const filename = fixture("config-files", "babelrc-error", "src.js");
+ test.each`
+ config | dir | error
+ ${".babelrc"} | ${"babelrc-error"} | ${/Error while parsing config - /}
+ ${".babelrc.js"} | ${"babelrc-js-error"} | ${/Babelrc threw an error/}
+ ${".babelrc.cjs"} | ${"babelrc-cjs-error"} | ${/Babelrc threw an error/}
+ ${"package.json"} | ${"pkg-error"} | ${/Error while parsing JSON - /}
+ `("should show helpful errors for $config", ({ dir, error }) => {
+ const filename = fixture("config-files", dir, "src.js");
- expect(() =>
- loadOptions({ filename, cwd: path.dirname(filename) }),
- ).toThrow(/Error while parsing config - /);
- });
-
- it("should show helpful errors for .babelrc.js", () => {
- const filename = fixture("config-files", "babelrc-js-error", "src.js");
-
- expect(() =>
- loadOptions({ filename, cwd: path.dirname(filename) }),
- ).toThrow(/Babelrc threw an error/);
- });
-
- it("should show helpful errors for package.json", () => {
- const filename = fixture("config-files", "pkg-error", "src.js");
-
- expect(() =>
- loadOptions({ filename, cwd: path.dirname(filename) }),
- ).toThrow(/Error while parsing JSON - /);
+ expect(() =>
+ loadOptions({ filename, cwd: path.dirname(filename) }),
+ ).toThrow(error);
+ });
});
it("should throw when `test` presents but `filename` is not passed", () => {
diff --git a/packages/babel-core/test/fixtures/config/config-files/babel-config-json/babel.config.json b/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc
similarity index 91%
rename from packages/babel-core/test/fixtures/config/config-files/babel-config-json/babel.config.json
rename to packages/babel-core/test/fixtures/config/config-files-templates/.babelrc
index 4b7be6033f68..b445e5d66381 100644
--- a/packages/babel-core/test/fixtures/config/config-files/babel-config-json/babel.config.json
+++ b/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc
@@ -1,3 +1,3 @@
{
"comments": true
-}
\ No newline at end of file
+}
diff --git a/packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.js b/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.cjs
similarity index 100%
rename from packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.js
rename to packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.cjs
diff --git a/packages/babel-core/test/fixtures/config/config-files/babel-config-js/babel.config.js b/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.js
similarity index 100%
rename from packages/babel-core/test/fixtures/config/config-files/babel-config-js/babel.config.js
rename to packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.js
diff --git a/packages/babel-core/test/fixtures/config/config-files/babelrc-js/.babelrc.js b/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.cjs
similarity index 55%
rename from packages/babel-core/test/fixtures/config/config-files/babelrc-js/.babelrc.js
rename to packages/babel-core/test/fixtures/config/config-files-templates/babel.config.cjs
index 37622f0ad309..409f4a98ac90 100644
--- a/packages/babel-core/test/fixtures/config/config-files/babelrc-js/.babelrc.js
+++ b/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.cjs
@@ -1,3 +1,3 @@
module.exports = {
- comments: true,
+ comments: true
};
diff --git a/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.js b/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.js
new file mode 100644
index 000000000000..409f4a98ac90
--- /dev/null
+++ b/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.js
@@ -0,0 +1,3 @@
+module.exports = {
+ comments: true
+};
diff --git a/packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.json b/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.json
similarity index 100%
rename from packages/babel-core/test/fixtures/config/config-files/babel-config-js-and-json/babel.config.json
rename to packages/babel-core/test/fixtures/config/config-files-templates/babel.config.json
diff --git a/packages/babel-core/test/fixtures/config/config-files/pkg/package.json b/packages/babel-core/test/fixtures/config/config-files-templates/package.json
similarity index 100%
rename from packages/babel-core/test/fixtures/config/config-files/pkg/package.json
rename to packages/babel-core/test/fixtures/config/config-files-templates/package.json
diff --git a/packages/babel-core/test/fixtures/config/config-files/babelrc-cjs-error/.babelrc.cjs b/packages/babel-core/test/fixtures/config/config-files/babelrc-cjs-error/.babelrc.cjs
new file mode 100644
index 000000000000..accbe7c461f1
--- /dev/null
+++ b/packages/babel-core/test/fixtures/config/config-files/babelrc-cjs-error/.babelrc.cjs
@@ -0,0 +1,3 @@
+module.exports = function() {
+ throw new Error("Babelrc threw an error");
+};
diff --git a/packages/babel-core/test/fixtures/config/config-files/babelrc/.babelrc b/packages/babel-core/test/fixtures/config/config-files/babelrc/.babelrc
deleted file mode 100644
index 2f6b10872c8d..000000000000
--- a/packages/babel-core/test/fixtures/config/config-files/babelrc/.babelrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- comments: true,
-}
diff --git a/packages/babel-core/test/fixtures/config/config-files/both-babelrc/.babelrc b/packages/babel-core/test/fixtures/config/config-files/both-babelrc/.babelrc
deleted file mode 100644
index 0967ef424bce..000000000000
--- a/packages/babel-core/test/fixtures/config/config-files/both-babelrc/.babelrc
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/packages/babel-core/test/fixtures/config/config-files/both-babelrc/.babelrc.js b/packages/babel-core/test/fixtures/config/config-files/both-babelrc/.babelrc.js
deleted file mode 100644
index f053ebf7976e..000000000000
--- a/packages/babel-core/test/fixtures/config/config-files/both-babelrc/.babelrc.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = {};
diff --git a/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc-js/.babelrc.js b/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc-js/.babelrc.js
deleted file mode 100644
index f053ebf7976e..000000000000
--- a/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc-js/.babelrc.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = {};
diff --git a/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc-js/package.json b/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc-js/package.json
deleted file mode 100644
index e25be3ecd260..000000000000
--- a/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc-js/package.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "babel": {}
-}
diff --git a/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc/.babelrc b/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc/.babelrc
deleted file mode 100644
index 0967ef424bce..000000000000
--- a/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc/.babelrc
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc/package.json b/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc/package.json
deleted file mode 100644
index e25be3ecd260..000000000000
--- a/packages/babel-core/test/fixtures/config/config-files/pkg-babelrc/package.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "babel": {}
-}
From 5c0d8a9de7c64fc309dbdf666c67f779b5dd439a Mon Sep 17 00:00:00 2001
From: Chris Garrett
Date: Mon, 4 Nov 2019 10:05:42 -0800
Subject: [PATCH 033/648] add legacy decorators support to strict class fields
(#10616)
This PR allows legacy decorators to work with strict class fields, which
are now stage 3 and have shipped in a number of browsers. Allowing this will
allow users of the legacy transform (which is currently recommended by the
champions of the decorator proposal) to use the proper class field semantics
for non-decorated fields, which should help prevent breakage later on.
This change is not a breaking change, since users had to explicitly opt into
loose mode in class fields before. This just gives them the option to remove
that opt-in.
---
packages/babel-helpers/src/helpers.js | 4 +-
.../local-define-property/input.js | 12 ++++++
.../local-define-property/options.json | 7 ++++
.../local-define-property/output.js | 40 +++++++++++++++++++
.../decorators-legacy-interop/loose/input.js | 9 +++++
.../loose/options.json | 7 ++++
.../decorators-legacy-interop/loose/output.js | 35 ++++++++++++++++
.../decorators-legacy-interop/strict/input.js | 9 +++++
.../strict/options.json | 7 ++++
.../strict/output.js | 37 +++++++++++++++++
.../decorator-interop/output.js | 2 +-
.../src/transformer-legacy.js | 20 ++++++++++
.../output.mjs | 2 +-
13 files changed, 186 insertions(+), 5 deletions(-)
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/input.js
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/options.json
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/output.js
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/input.js
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/options.json
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/output.js
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/input.js
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/options.json
create mode 100644 packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/output.js
diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js
index 23416e002296..8fb04a895307 100644
--- a/packages/babel-helpers/src/helpers.js
+++ b/packages/babel-helpers/src/helpers.js
@@ -1040,9 +1040,7 @@ helpers.initializerWarningHelper = helper("7.0.0-beta.0")`
export default function _initializerWarningHelper(descriptor, context){
throw new Error(
'Decorating class property failed. Please ensure that ' +
- 'proposal-class-properties is enabled and set to use loose mode. ' +
- 'To use proposal-class-properties in spec mode with decorators, wait for ' +
- 'the next major version of decorators in stage 2.'
+ 'proposal-class-properties is enabled and runs after the decorators transform.'
);
}
`;
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/input.js
new file mode 100644
index 000000000000..f939e63b3b71
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/input.js
@@ -0,0 +1,12 @@
+function dec() {}
+
+// Create a local function binding so babel has to change the name of the helper
+function _defineProperty() {}
+
+class A {
+ @dec a;
+
+ @dec b = 123;
+
+ c = 456;
+}
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/options.json b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/options.json
new file mode 100644
index 000000000000..6f03cd7aad03
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/options.json
@@ -0,0 +1,7 @@
+{
+ "plugins": [
+ ["proposal-decorators", { "legacy": true }],
+ ["proposal-class-properties"],
+ "transform-classes"
+ ]
+}
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/output.js
new file mode 100644
index 000000000000..641307b44d0d
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/local-define-property/output.js
@@ -0,0 +1,40 @@
+var _class, _descriptor, _descriptor2, _temp;
+
+function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _defineProperty2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
+function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
+
+function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
+
+function dec() {} // Create a local function binding so babel has to change the name of the helper
+
+
+function _defineProperty() {}
+
+let A = (_class = (_temp = function A() {
+ "use strict";
+
+ _classCallCheck(this, A);
+
+ _initializerDefineProperty(this, "a", _descriptor, this);
+
+ _initializerDefineProperty(this, "b", _descriptor2, this);
+
+ _defineProperty2(this, "c", 456);
+}, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "a", [dec], {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ initializer: null
+}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "b", [dec], {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ initializer: function () {
+ return 123;
+ }
+})), _class);
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/input.js
new file mode 100644
index 000000000000..92298f2eb49b
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/input.js
@@ -0,0 +1,9 @@
+function dec() {}
+
+class A {
+ @dec a;
+
+ @dec b = 123;
+
+ c = 456;
+}
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/options.json b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/options.json
new file mode 100644
index 000000000000..8c831989533b
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/options.json
@@ -0,0 +1,7 @@
+{
+ "plugins": [
+ ["proposal-decorators", { "legacy": true }],
+ ["proposal-class-properties", { "loose": true }],
+ "transform-classes"
+ ]
+}
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/output.js
new file mode 100644
index 000000000000..0a25e2b1023c
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/loose/output.js
@@ -0,0 +1,35 @@
+var _class, _descriptor, _descriptor2, _temp;
+
+function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
+
+function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
+
+function dec() {}
+
+let A = (_class = (_temp = function A() {
+ "use strict";
+
+ _classCallCheck(this, A);
+
+ _initializerDefineProperty(this, "a", _descriptor, this);
+
+ _initializerDefineProperty(this, "b", _descriptor2, this);
+
+ this.c = 456;
+}, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "a", [dec], {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ initializer: null
+}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "b", [dec], {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ initializer: function () {
+ return 123;
+ }
+})), _class);
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/input.js
new file mode 100644
index 000000000000..92298f2eb49b
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/input.js
@@ -0,0 +1,9 @@
+function dec() {}
+
+class A {
+ @dec a;
+
+ @dec b = 123;
+
+ c = 456;
+}
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/options.json b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/options.json
new file mode 100644
index 000000000000..6f03cd7aad03
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/options.json
@@ -0,0 +1,7 @@
+{
+ "plugins": [
+ ["proposal-decorators", { "legacy": true }],
+ ["proposal-class-properties"],
+ "transform-classes"
+ ]
+}
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/output.js
new file mode 100644
index 000000000000..11cce4ac923d
--- /dev/null
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/decorators-legacy-interop/strict/output.js
@@ -0,0 +1,37 @@
+var _class, _descriptor, _descriptor2, _temp;
+
+function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
+function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
+
+function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
+
+function dec() {}
+
+let A = (_class = (_temp = function A() {
+ "use strict";
+
+ _classCallCheck(this, A);
+
+ _initializerDefineProperty(this, "a", _descriptor, this);
+
+ _initializerDefineProperty(this, "b", _descriptor2, this);
+
+ _defineProperty(this, "c", 456);
+}, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "a", [dec], {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ initializer: null
+}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "b", [dec], {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ initializer: function () {
+ return 123;
+ }
+})), _class);
diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/static-property-tdz/decorator-interop/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/static-property-tdz/decorator-interop/output.js
index 2cd978b722c9..9a71c175287f 100644
--- a/packages/babel-plugin-proposal-class-properties/test/fixtures/static-property-tdz/decorator-interop/output.js
+++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/static-property-tdz/decorator-interop/output.js
@@ -12,7 +12,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
-function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }
+function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
function dec() {}
diff --git a/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js b/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
index d6160db14c55..ca23bad24824 100644
--- a/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
+++ b/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
@@ -290,4 +290,24 @@ export default {
]),
);
},
+
+ CallExpression(path, state) {
+ if (path.node.arguments.length !== 3) return;
+ if (!WARNING_CALLS.has(path.node.arguments[2])) return;
+
+ // If the class properties plugin isn't enabled, this line will add an unused helper
+ // to the code. It's not ideal, but it's ok since the configuration is not valid anyway.
+ if (path.node.callee.name !== state.addHelper("defineProperty").name) {
+ return;
+ }
+
+ path.replaceWith(
+ t.callExpression(state.addHelper("initializerDefineProperty"), [
+ t.cloneNode(path.get("arguments")[0].node),
+ t.cloneNode(path.get("arguments")[1].node),
+ t.cloneNode(path.get("arguments.2.arguments")[0].node),
+ t.cloneNode(path.get("arguments.2.arguments")[1].node),
+ ]),
+ );
+ },
};
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/abstract-class-decorated-parameter/output.mjs b/packages/babel-plugin-transform-typescript/test/fixtures/class/abstract-class-decorated-parameter/output.mjs
index e8982550efbf..58aa80d516ec 100644
--- a/packages/babel-plugin-transform-typescript/test/fixtures/class/abstract-class-decorated-parameter/output.mjs
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/abstract-class-decorated-parameter/output.mjs
@@ -2,7 +2,7 @@ var _class, _descriptor;
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
-function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }
+function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
import { observable } from 'mobx';
let Foo = (_class = class Foo {
From abce0ef49d4f3b204b9d570b763839101772a56a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Mon, 4 Nov 2019 19:22:49 +0100
Subject: [PATCH 034/648] [TS] Correctly transform computed strings and
templates in enums (#10555)
* [TS] Correctly transform computed strings and templates in enums
* Typo [skip ci]
---
packages/babel-plugin-transform-typescript/src/enum.js | 10 +++++++---
.../test/fixtures/enum/string-value-template/input.ts | 3 +++
.../test/fixtures/enum/string-value-template/output.js | 5 +++++
.../enum/{string-values => string-value}/input.ts | 0
.../enum/{string-values => string-value}/output.js | 0
.../test/fixtures/enum/string-values-computed/input.ts | 1 -
.../fixtures/enum/string-values-computed/output.js | 3 +--
7 files changed, 16 insertions(+), 6 deletions(-)
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/input.ts
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/output.js
rename packages/babel-plugin-transform-typescript/test/fixtures/enum/{string-values => string-value}/input.ts (100%)
rename packages/babel-plugin-transform-typescript/test/fixtures/enum/{string-values => string-value}/output.js (100%)
diff --git a/packages/babel-plugin-transform-typescript/src/enum.js b/packages/babel-plugin-transform-typescript/src/enum.js
index 11c7b5376d83..3b604e2e8fab 100644
--- a/packages/babel-plugin-transform-typescript/src/enum.js
+++ b/packages/babel-plugin-transform-typescript/src/enum.js
@@ -144,13 +144,12 @@ function evaluate(
expr,
seen: PreviousEnumMembers,
): number | string | typeof undefined {
- if (expr.type === "StringLiteral") {
- return expr.value;
- }
return evalConstant(expr);
function evalConstant(expr): number | typeof undefined {
switch (expr.type) {
+ case "StringLiteral":
+ return expr.value;
case "UnaryExpression":
return evalUnaryExpression(expr);
case "BinaryExpression":
@@ -161,6 +160,11 @@ function evaluate(
return evalConstant(expr.expression);
case "Identifier":
return seen[expr.name];
+ case "TemplateLiteral":
+ if (expr.quasis.length === 1) {
+ return expr.quasis[0].value.cooked;
+ }
+ /* falls through */
default:
return undefined;
}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/input.ts
new file mode 100644
index 000000000000..01086419eaff
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/input.ts
@@ -0,0 +1,3 @@
+enum E {
+ A = `Hey`
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/output.js
new file mode 100644
index 000000000000..dfc0f72fcd49
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/output.js
@@ -0,0 +1,5 @@
+var E;
+
+(function (E) {
+ E["A"] = "Hey";
+})(E || (E = {}));
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value/input.ts
similarity index 100%
rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/input.ts
rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value/input.ts
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value/output.js
similarity index 100%
rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/output.js
rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value/output.js
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/input.ts
index ac52806fb927..06e9b00f0682 100644
--- a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/input.ts
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/input.ts
@@ -1,4 +1,3 @@
-// Not type-correct code
enum E {
A = "HALLO" + "WERLD"
}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/output.js
index e449a1ca233d..a0f3ea2ca81f 100644
--- a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/output.js
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/output.js
@@ -1,6 +1,5 @@
-// Not type-correct code
var E;
(function (E) {
- E[E["A"] = "HALLO" + "WERLD"] = "A";
+ E["A"] = "HALLOWERLD";
})(E || (E = {}));
From d023e105b729ab7f8634d32733c3029ca199346a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Mon, 4 Nov 2019 19:25:15 +0100
Subject: [PATCH 035/648] [TS] Parse calls with type args in optional chains
(#10631)
* [TS] Parse calls with type args in optional chains
* Test output
---
.../babel-parser/src/parser/expression.js | 32 +--
packages/babel-parser/src/plugins/flow.js | 12 +-
.../src/plugins/typescript/index.js | 2 +-
.../optional-chaining/type-arguments/input.ts | 1 +
.../type-arguments/options.json | 4 +
.../type-arguments/output.json | 182 ++++++++++++++++++
6 files changed, 204 insertions(+), 29 deletions(-)
create mode 100644 packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/output.json
diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js
index 79abd269e184..eb7952a3e8d9 100644
--- a/packages/babel-parser/src/parser/expression.js
+++ b/packages/babel-parser/src/parser/expression.js
@@ -628,7 +628,7 @@ export default class ExpressionParser extends LValParser {
node.callee = base;
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
node.optional = true;
- return this.finishNode(node, "OptionalCallExpression");
+ return this.finishCallExpression(node, /* optional */ true);
} else {
node.object = base;
node.property = this.parseIdentifier(true);
@@ -683,11 +683,7 @@ export default class ExpressionParser extends LValParser {
base.type !== "Super",
node,
);
- if (!state.optionalChainMember) {
- this.finishCallExpression(node);
- } else {
- this.finishOptionalCallExpression(node);
- }
+ this.finishCallExpression(node, state.optionalChainMember);
if (state.maybeAsyncArrow && this.shouldParseAsyncArrow()) {
state.stop = true;
@@ -783,21 +779,10 @@ export default class ExpressionParser extends LValParser {
);
}
- finishCallExpression(node: N.CallExpression): N.CallExpression {
- if (node.callee.type === "Import") {
- if (node.arguments.length !== 1) {
- this.raise(node.start, "import() requires exactly one argument");
- }
-
- const importArg = node.arguments[0];
- if (importArg && importArg.type === "SpreadElement") {
- this.raise(importArg.start, "... is not allowed in import()");
- }
- }
- return this.finishNode(node, "CallExpression");
- }
-
- finishOptionalCallExpression(node: N.CallExpression): N.CallExpression {
+ finishCallExpression(
+ node: T,
+ optional: boolean,
+ ): T {
if (node.callee.type === "Import") {
if (node.arguments.length !== 1) {
this.raise(node.start, "import() requires exactly one argument");
@@ -808,7 +793,10 @@ export default class ExpressionParser extends LValParser {
this.raise(importArg.start, "... is not allowed in import()");
}
}
- return this.finishNode(node, "OptionalCallExpression");
+ return this.finishNode(
+ node,
+ optional ? "OptionalCallExpression" : "CallExpression",
+ );
}
parseCallExpressionArguments(
diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js
index d4c815d38b45..fcdd16df61d2 100644
--- a/packages/babel-parser/src/plugins/flow.js
+++ b/packages/babel-parser/src/plugins/flow.js
@@ -2709,7 +2709,7 @@ export default (superClass: Class): Class =>
// $FlowFixMe
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
node.optional = true;
- return this.finishNode(node, "OptionalCallExpression");
+ return this.finishCallExpression(node, /* optional */ true);
} else if (
!noCalls &&
this.shouldParseTypes() &&
@@ -2722,11 +2722,11 @@ export default (superClass: Class): Class =>
node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
this.expect(tt.parenL);
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
- if (subscriptState.optionalChainMember) {
- node.optional = false;
- return this.finishNode(node, "OptionalCallExpression");
- }
- return this.finishNode(node, "CallExpression");
+ if (subscriptState.optionalChainMember) node.optional = false;
+ return this.finishCallExpression(
+ node,
+ subscriptState.optionalChainMember,
+ );
} catch (e) {
if (e instanceof SyntaxError) {
this.state = state;
diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js
index 26a6246d59e6..4dc707be7cb9 100644
--- a/packages/babel-parser/src/plugins/typescript/index.js
+++ b/packages/babel-parser/src/plugins/typescript/index.js
@@ -1655,7 +1655,7 @@ export default (superClass: Class): Class =>
/* possibleAsync */ false,
);
node.typeParameters = typeArguments;
- return this.finishCallExpression(node);
+ return this.finishCallExpression(node, state.optionalChainMember);
} else if (this.match(tt.backQuote)) {
return this.parseTaggedTemplateExpression(
startPos,
diff --git a/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/input.ts b/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/input.ts
new file mode 100644
index 000000000000..731a05f63b36
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/input.ts
@@ -0,0 +1 @@
+example.inner?.greet()
diff --git a/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/options.json b/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/options.json
new file mode 100644
index 000000000000..ccc6341666b4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/options.json
@@ -0,0 +1,4 @@
+{
+ "sourceType": "module",
+ "plugins": ["typescript", "optionalChaining"]
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/output.json b/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/output.json
new file mode 100644
index 000000000000..42f6c8b98b0e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/output.json
@@ -0,0 +1,182 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "expression": {
+ "type": "OptionalCallExpression",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "callee": {
+ "type": "OptionalMemberExpression",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "object": {
+ "type": "MemberExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "example"
+ },
+ "name": "example"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "inner"
+ },
+ "name": "inner"
+ },
+ "computed": false
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "greet"
+ },
+ "name": "greet"
+ },
+ "computed": false,
+ "optional": true
+ },
+ "arguments": [],
+ "typeParameters": {
+ "type": "TSTypeParameterInstantiation",
+ "start": 20,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "params": [
+ {
+ "type": "TSStringKeyword",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
From 5e240166233bd78049fda6f05f6d2be9bbdd7ff8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Mon, 4 Nov 2019 15:51:24 -0500
Subject: [PATCH 036/648] fix: remove ExportNamedDeclaration when the specifier
is empty (#10638)
---
.../babel-plugin-transform-modules-systemjs/src/index.js | 2 ++
.../test/fixtures/systemjs/export-named-8/input.mjs | 1 +
.../test/fixtures/systemjs/export-named-8/output.mjs | 8 ++++++++
3 files changed, 11 insertions(+)
create mode 100644 packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-8/input.mjs
create mode 100644 packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-8/output.mjs
diff --git a/packages/babel-plugin-transform-modules-systemjs/src/index.js b/packages/babel-plugin-transform-modules-systemjs/src/index.js
index 779b76170cdc..c09a438262bc 100644
--- a/packages/babel-plugin-transform-modules-systemjs/src/index.js
+++ b/packages/babel-plugin-transform-modules-systemjs/src/index.js
@@ -413,6 +413,8 @@ export default declare((api, options) => {
path.replaceWithMultiple(nodes);
}
+ } else {
+ path.remove();
}
}
}
diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-8/input.mjs b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-8/input.mjs
new file mode 100644
index 000000000000..336ce12bb910
--- /dev/null
+++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-8/input.mjs
@@ -0,0 +1 @@
+export {}
diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-8/output.mjs b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-8/output.mjs
new file mode 100644
index 000000000000..5ed7cacb99d1
--- /dev/null
+++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-8/output.mjs
@@ -0,0 +1,8 @@
+System.register([], function (_export, _context) {
+ "use strict";
+
+ return {
+ setters: [],
+ execute: function () {}
+ };
+});
From 43aa7e262c6ee60f7f8afbe1d04c654e06449905 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Mon, 4 Nov 2019 22:50:36 +0100
Subject: [PATCH 037/648] Don't throw when destructuring into a var named as an
import (#10628)
---
.../src/rewrite-live-references.js | 28 +++++++++----------
.../misc/import-shadowed-assign/input.mjs | 12 ++++++++
.../misc/import-shadowed-assign/output.js | 23 +++++++++++++++
3 files changed, 48 insertions(+), 15 deletions(-)
create mode 100644 packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-shadowed-assign/input.mjs
create mode 100644 packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-shadowed-assign/output.js
diff --git a/packages/babel-helper-module-transforms/src/rewrite-live-references.js b/packages/babel-helper-module-transforms/src/rewrite-live-references.js
index 185ba9142220..8bd93f509c25 100644
--- a/packages/babel-helper-module-transforms/src/rewrite-live-references.js
+++ b/packages/babel-helper-module-transforms/src/rewrite-live-references.js
@@ -224,6 +224,10 @@ const rewriteReferencesVisitor = {
seen.add(path.node);
const left = path.get("left");
+
+ // No change needed
+ if (left.isMemberExpression()) return;
+
if (left.isIdentifier()) {
// Simple update-assign foo += 1; export { foo };
// => exports.foo = (foo += 1);
@@ -234,9 +238,9 @@ const rewriteReferencesVisitor = {
return;
}
- const exportedNames = exported.get(localName) || [];
+ const exportedNames = exported.get(localName);
const importData = imported.get(localName);
- if (exportedNames.length > 0 || importData) {
+ if (exportedNames?.length > 0 || importData) {
assert(path.node.operator === "=", "Path was not simplified");
const assignment = path.node;
@@ -259,13 +263,14 @@ const rewriteReferencesVisitor = {
);
requeueInParent(path);
}
- } else if (left.isMemberExpression()) {
- // No change needed
} else {
const ids = left.getOuterBindingIdentifiers();
- const id = Object.keys(ids)
- .filter(localName => imported.has(localName))
- .pop();
+ const programScopeIds = Object.keys(ids).filter(
+ localName =>
+ scope.getBinding(localName) === path.scope.getBinding(localName),
+ );
+ const id = programScopeIds.find(localName => imported.has(localName));
+
if (id) {
path.node.right = t.sequenceExpression([
path.node.right,
@@ -276,14 +281,7 @@ const rewriteReferencesVisitor = {
// Complex ({a, b, c} = {}); export { a, c };
// => ({a, b, c} = {}), (exports.a = a, exports.c = c);
const items = [];
- Object.keys(ids).forEach(localName => {
- // redeclared in this scope
- if (
- scope.getBinding(localName) !== path.scope.getBinding(localName)
- ) {
- return;
- }
-
+ programScopeIds.forEach(localName => {
const exportedNames = exported.get(localName) || [];
if (exportedNames.length > 0) {
items.push(
diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-shadowed-assign/input.mjs b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-shadowed-assign/input.mjs
new file mode 100644
index 000000000000..0ba3bfe4e6bc
--- /dev/null
+++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-shadowed-assign/input.mjs
@@ -0,0 +1,12 @@
+import { foo } from "x";
+
+function f(foo) {
+ foo = 2;
+ [foo] = [];
+ ({ foo } = {});
+}
+
+
+foo = 2;
+[foo] = [];
+({ foo } = {});
diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-shadowed-assign/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-shadowed-assign/output.js
new file mode 100644
index 000000000000..d78aaf7826e6
--- /dev/null
+++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-shadowed-assign/output.js
@@ -0,0 +1,23 @@
+"use strict";
+
+var _x = require("x");
+
+function f(foo) {
+ foo = 2;
+ [foo] = [];
+ ({
+ foo
+ } = {});
+}
+
+_x.foo = (2, function () {
+ throw new Error('"' + "foo" + '" is read-only.');
+}());
+[foo] = ([], function () {
+ throw new Error('"' + "foo" + '" is read-only.');
+}());
+({
+ foo
+} = ({}, function () {
+ throw new Error('"' + "foo" + '" is read-only.');
+}()));
From 861844761f9c911e3c2ab44173372775399fd76c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Mon, 4 Nov 2019 22:53:53 +0100
Subject: [PATCH 038/648] =?UTF-8?q?[preset-env]=20Don't=20use=20async-to-g?=
=?UTF-8?q?enerator=20when=20already=20using=20re=E2=80=A6=20(#9481)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* [preset-env] Don't use async-to-generator when already using regenerator
* Add tests
* Update fixtures
---
.../test/fixtures/regression/T6755/output.js | 42 ++++++-------------
.../test/fixtures/regression/4219/output.js | 35 ++++++----------
.../data/overlapping-plugins.js | 15 +++++++
packages/babel-preset-env/src/filter-items.js | 10 +++++
packages/babel-preset-env/src/index.js | 4 +-
.../usage-regenerator-used-async/output.mjs | 31 ++++----------
.../usage-regenerator-used-async/output.mjs | 29 ++++---------
.../corejs-without-usebuiltins/stdout.txt | 1 -
.../debug/entry-corejs2-android/stdout.txt | 1 -
.../debug/entry-corejs2-electron/stdout.txt | 1 -
.../stdout.txt | 1 -
.../debug/entry-corejs2-proposals/stdout.txt | 1 -
.../entry-corejs2-shippedProposals/stdout.txt | 1 -
.../entry-corejs2-specific-targets/stdout.txt | 1 -
.../stdout.txt | 1 -
.../entry-corejs2-versions-strings/stdout.txt | 1 -
.../fixtures/debug/entry-corejs2/stdout.txt | 1 -
.../debug/entry-corejs3-all/stdout.txt | 1 -
.../debug/entry-corejs3-android/stdout.txt | 1 -
.../entry-corejs3-babel-polyfill/stdout.txt | 1 -
.../debug/entry-corejs3-electron/stdout.txt | 1 -
.../entry-corejs3-es-proposals/stdout.txt | 1 -
.../debug/entry-corejs3-es/stdout.txt | 1 -
.../stdout.txt | 1 -
.../debug/entry-corejs3-proposals/stdout.txt | 1 -
.../entry-corejs3-specific-entries/stdout.txt | 1 -
.../entry-corejs3-specific-targets/stdout.txt | 1 -
.../debug/entry-corejs3-stable/stdout.txt | 1 -
.../debug/entry-corejs3-stage/stdout.txt | 1 -
.../stdout.txt | 1 -
.../stdout.txt | 1 -
.../stdout.txt | 1 -
.../entry-corejs3-versions-strings/stdout.txt | 1 -
.../debug/entry-corejs3-web/stdout.txt | 1 -
.../fixtures/debug/entry-corejs3/stdout.txt | 1 -
.../stdout.txt | 1 -
.../debug/entry-no-corejs-uglify/stdout.txt | 1 -
.../fixtures/debug/entry-no-corejs/stdout.txt | 1 -
.../fixtures/debug/usage-corejs2-1/stdout.txt | 1 -
.../fixtures/debug/usage-corejs2-2/stdout.txt | 1 -
.../debug/usage-corejs2-none-1/stdout.txt | 1 -
.../debug/usage-corejs2-none-2/stdout.txt | 1 -
.../usage-corejs2-proposals-1/stdout.txt | 1 -
.../usage-corejs2-proposals-2/stdout.txt | 1 -
.../stdout.txt | 1 -
.../stdout.txt | 1 -
.../fixtures/debug/usage-corejs3-1/stdout.txt | 1 -
.../fixtures/debug/usage-corejs3-2/stdout.txt | 1 -
.../debug/usage-corejs3-none-1/stdout.txt | 1 -
.../debug/usage-corejs3-none-2/stdout.txt | 1 -
.../usage-corejs3-proposals-1/stdout.txt | 1 -
.../usage-corejs3-proposals-2/stdout.txt | 1 -
.../stdout.txt | 1 -
.../stdout.txt | 1 -
.../stdout.txt | 1 -
.../stdout.txt | 1 -
.../stdout.txt | 1 -
.../stdout.txt | 1 -
.../debug/usage-no-corejs-1/stdout.txt | 1 -
.../debug/usage-no-corejs-2/stdout.txt | 1 -
.../debug/usage-no-corejs-none-1/stdout.txt | 1 -
.../debug/usage-no-corejs-none-2/stdout.txt | 1 -
.../plugins-overlapping/chrome-49/input.js | 1 +
.../chrome-49/options.json | 11 +++++
.../plugins-overlapping/chrome-49/output.js | 9 ++++
.../plugins-overlapping/chrome-50/input.js | 1 +
.../chrome-50/options.json | 11 +++++
.../plugins-overlapping/chrome-50/output.js | 12 ++++++
.../plugins-overlapping/chrome-54/input.js | 1 +
.../chrome-54/options.json | 11 +++++
.../plugins-overlapping/chrome-54/output.js | 12 ++++++
.../plugins-overlapping/chrome-55/input.js | 1 +
.../chrome-55/options.json | 11 +++++
.../plugins-overlapping/chrome-55/output.js | 1 +
74 files changed, 152 insertions(+), 151 deletions(-)
create mode 100644 packages/babel-preset-env/data/overlapping-plugins.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/input.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/options.json
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/output.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/input.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/options.json
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/output.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/input.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/options.json
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/output.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/input.js
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/options.json
create mode 100644 packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/output.js
diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/T6755/output.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/T6755/output.js
index 435ad8c4dfa3..204120c62c82 100644
--- a/packages/babel-plugin-transform-classes/test/fixtures/regression/T6755/output.js
+++ b/packages/babel-plugin-transform-classes/test/fixtures/regression/T6755/output.js
@@ -1,7 +1,3 @@
-function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
-
-function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
-
var Example =
/*#__PURE__*/
function () {
@@ -11,33 +7,21 @@ function () {
var _proto = Example.prototype;
- _proto.test1 =
- /*#__PURE__*/
- function () {
- var _test = _asyncToGenerator(
- /*#__PURE__*/
- regeneratorRuntime.mark(function _callee() {
- return regeneratorRuntime.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _context.next = 2;
- return Promise.resolve(2);
+ _proto.test1 = function test1() {
+ return regeneratorRuntime.async(function test1$(_context) {
+ while (1) {
+ switch (_context.prev = _context.next) {
+ case 0:
+ _context.next = 2;
+ return regeneratorRuntime.awrap(Promise.resolve(2));
- case 2:
- case "end":
- return _context.stop();
- }
+ case 2:
+ case "end":
+ return _context.stop();
}
- }, _callee);
- }));
-
- function test1() {
- return _test.apply(this, arguments);
- }
-
- return test1;
- }();
+ }
+ });
+ };
_proto.test2 =
/*#__PURE__*/
diff --git a/packages/babel-plugin-transform-regenerator/test/fixtures/regression/4219/output.js b/packages/babel-plugin-transform-regenerator/test/fixtures/regression/4219/output.js
index 0b2d02f3770d..a3b8fd1f26c4 100644
--- a/packages/babel-plugin-transform-regenerator/test/fixtures/regression/4219/output.js
+++ b/packages/babel-plugin-transform-regenerator/test/fixtures/regression/4219/output.js
@@ -1,26 +1,17 @@
-function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
-
-function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
-
function test(fn) {
- return (
- /*#__PURE__*/
- _asyncToGenerator(
- /*#__PURE__*/
- regeneratorRuntime.mark(function _callee() {
- var _args = arguments;
- return regeneratorRuntime.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.abrupt("return", fn.apply(void 0, _args));
+ return function _callee() {
+ var _args = arguments;
+ return regeneratorRuntime.async(function _callee$(_context) {
+ while (1) {
+ switch (_context.prev = _context.next) {
+ case 0:
+ return _context.abrupt("return", fn.apply(void 0, _args));
- case 1:
- case "end":
- return _context.stop();
- }
+ case 1:
+ case "end":
+ return _context.stop();
}
- }, _callee);
- }))
- );
+ }
+ });
+ };
}
diff --git a/packages/babel-preset-env/data/overlapping-plugins.js b/packages/babel-preset-env/data/overlapping-plugins.js
new file mode 100644
index 000000000000..84c0d416b4ad
--- /dev/null
+++ b/packages/babel-preset-env/data/overlapping-plugins.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = new Map();
+
+// async -> regenerator is better than async -> generator -> regenerator
+ifIncluded("transform-regenerator")
+ .isUnnecessary("transform-async-to-generator");
+
+function ifIncluded(name) {
+ const set = new Set();
+ module.exports.set(name, set);
+ return {
+ isUnnecessary(name) { set.add(name); return this; }
+ };
+}
diff --git a/packages/babel-preset-env/src/filter-items.js b/packages/babel-preset-env/src/filter-items.js
index 7d9c07026eba..3c5a3297083f 100644
--- a/packages/babel-preset-env/src/filter-items.js
+++ b/packages/babel-preset-env/src/filter-items.js
@@ -85,3 +85,13 @@ export default function(
return result;
}
+
+export function removeUnnecessaryItems(
+ items: Set,
+ overlapping: Map>,
+) {
+ items.forEach(item => {
+ const names = overlapping.get(item);
+ if (names) names.forEach(name => items.delete(name));
+ });
+}
diff --git a/packages/babel-preset-env/src/index.js b/packages/babel-preset-env/src/index.js
index b1d335e5527a..1c0b08f853df 100644
--- a/packages/babel-preset-env/src/index.js
+++ b/packages/babel-preset-env/src/index.js
@@ -3,11 +3,12 @@
import { SemVer } from "semver";
import { logPluginOrPolyfill } from "./debug";
import getOptionSpecificExcludesFor from "./get-option-specific-excludes";
-import filterItems from "./filter-items";
+import filterItems, { removeUnnecessaryItems } from "./filter-items";
import moduleTransformations from "./module-transformations";
import normalizeOptions from "./normalize-options";
import pluginList from "../data/plugins.json";
import { proposalPlugins, pluginSyntaxMap } from "../data/shipped-proposals";
+import overlappingPlugins from "../data/overlapping-plugins";
import addCoreJS2UsagePlugin from "./polyfills/corejs2/usage-plugin";
import addCoreJS3UsagePlugin from "./polyfills/corejs3/usage-plugin";
@@ -248,6 +249,7 @@ export default declare((api, opts) => {
getOptionSpecificExcludesFor({ loose }),
pluginSyntaxMap,
);
+ removeUnnecessaryItems(pluginNames, overlappingPlugins);
const polyfillPlugins = getPolyfillPlugins({
useBuiltIns,
diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-async/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-async/output.mjs
index db18b8bfe116..178c426ba53f 100644
--- a/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-async/output.mjs
+++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-async/output.mjs
@@ -1,28 +1,13 @@
import "regenerator-runtime/runtime";
-import "core-js/modules/es6.promise";
-import "core-js/modules/es6.object.to-string";
-
-function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
-
-function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
function a() {
- return _a.apply(this, arguments);
-}
-
-function _a() {
- _a = _asyncToGenerator(
- /*#__PURE__*/
- regeneratorRuntime.mark(function _callee() {
- return regeneratorRuntime.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- case "end":
- return _context.stop();
- }
+ return regeneratorRuntime.async(function a$(_context) {
+ while (1) {
+ switch (_context.prev = _context.next) {
+ case 0:
+ case "end":
+ return _context.stop();
}
- }, _callee);
- }));
- return _a.apply(this, arguments);
+ }
+ });
}
diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async/output.mjs
index 5663fd906a75..03624378656f 100644
--- a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async/output.mjs
+++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async/output.mjs
@@ -2,27 +2,14 @@ import "core-js/modules/es.object.to-string";
import "core-js/modules/es.promise";
import "regenerator-runtime/runtime";
-function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
-
-function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
-
function a() {
- return _a.apply(this, arguments);
-}
-
-function _a() {
- _a = _asyncToGenerator(
- /*#__PURE__*/
- regeneratorRuntime.mark(function _callee() {
- return regeneratorRuntime.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- case "end":
- return _context.stop();
- }
+ return regeneratorRuntime.async(function a$(_context) {
+ while (1) {
+ switch (_context.prev = _context.next) {
+ case 0:
+ case "end":
+ return _context.stop();
}
- }, _callee);
- }));
- return _a.apply(this, arguments);
+ }
+ });
}
diff --git a/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt
index dd2af17fc22d..d263c3020966 100644
--- a/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt
@@ -30,7 +30,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/stdout.txt
index d4cb727787d8..b2d6215dfff4 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/stdout.txt
@@ -30,7 +30,6 @@ Using plugins:
transform-new-target { "android":"4" }
transform-regenerator { "android":"4" }
transform-exponentiation-operator { "android":"4" }
- transform-async-to-generator { "android":"4" }
proposal-async-generator-functions { "android":"4" }
proposal-object-rest-spread { "android":"4" }
proposal-unicode-property-regex { "android":"4" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/stdout.txt
index c3c18fa3a051..bfc587d621ae 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/stdout.txt
@@ -25,7 +25,6 @@ Using plugins:
transform-block-scoping { "electron":"0.36" }
transform-regenerator { "electron":"0.36" }
transform-exponentiation-operator { "electron":"0.36" }
- transform-async-to-generator { "electron":"0.36" }
proposal-async-generator-functions { "electron":"0.36" }
proposal-object-rest-spread { "electron":"0.36" }
proposal-unicode-property-regex { "electron":"0.36" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/stdout.txt
index 32637c13542d..f5645e48ccb3 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/stdout.txt
@@ -30,7 +30,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions { "chrome":"55" }
proposal-object-rest-spread { "chrome":"55" }
proposal-unicode-property-regex { "chrome":"55" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/stdout.txt
index e5a186c32135..bea5ddcef506 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/stdout.txt
index cbffdcc578f3..bc8c000777a8 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/stdout.txt
index 16202760ee72..fd3e8b442630 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/stdout.txt
@@ -35,7 +35,6 @@ Using plugins:
transform-new-target { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
transform-regenerator { "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-exponentiation-operator { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
- transform-async-to-generator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
proposal-async-generator-functions { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
proposal-object-rest-spread { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
proposal-unicode-property-regex { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/stdout.txt
index 63ba5e06fce5..afe468aa8aba 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/stdout.txt
@@ -41,7 +41,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "electron":"0.36", "ie":"10" }
transform-exponentiation-operator { "electron":"0.36", "ie":"10", "node":"6.1" }
- transform-async-to-generator { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
proposal-async-generator-functions { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
proposal-object-rest-spread { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
proposal-unicode-property-regex { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/stdout.txt
index ae6350c447da..c14636d386e1 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/stdout.txt
@@ -32,7 +32,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6.10" }
- transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-async-generator-functions { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-object-rest-spread { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6.10" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/stdout.txt
index 4b45c43d32d2..14ad1ce4b6cd 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/stdout.txt
@@ -32,7 +32,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6" }
- transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6" }
proposal-async-generator-functions { "chrome":"54", "ie":"10", "node":"6" }
proposal-object-rest-spread { "chrome":"54", "ie":"10", "node":"6" }
proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/stdout.txt
index 0d0f575f70c3..38e834034f84 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/stdout.txt
index 42d9f81c58b4..684f0ebd9aa1 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/stdout.txt
@@ -30,7 +30,6 @@ Using plugins:
transform-new-target { "android":"4" }
transform-regenerator { "android":"4" }
transform-exponentiation-operator { "android":"4" }
- transform-async-to-generator { "android":"4" }
proposal-async-generator-functions { "android":"4" }
proposal-object-rest-spread { "android":"4" }
proposal-unicode-property-regex { "android":"4" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stdout.txt
index a900b4720ab0..e730eb6421ca 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/stdout.txt
index 85026b3df8e2..32c6a7530002 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/stdout.txt
@@ -25,7 +25,6 @@ Using plugins:
transform-block-scoping { "electron":"0.36" }
transform-regenerator { "electron":"0.36" }
transform-exponentiation-operator { "electron":"0.36" }
- transform-async-to-generator { "electron":"0.36" }
proposal-async-generator-functions { "electron":"0.36" }
proposal-object-rest-spread { "electron":"0.36" }
proposal-unicode-property-regex { "electron":"0.36" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/stdout.txt
index 07743893310e..39b7566a4edc 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/stdout.txt
index f6c3da52ca39..cf8816e74969 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/stdout.txt
index dbc3ba935e3e..2733197a3382 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/stdout.txt
@@ -30,7 +30,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions { "chrome":"55" }
proposal-object-rest-spread { "chrome":"55" }
proposal-unicode-property-regex { "chrome":"55" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/stdout.txt
index 2d70ebb4d616..b400e3b3da64 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/stdout.txt
index 237cf943f7c3..9b8ceb81a002 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt
index cda9f2bec5f3..2229f64bab90 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt
@@ -35,7 +35,6 @@ Using plugins:
transform-new-target { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
transform-regenerator { "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-exponentiation-operator { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
- transform-async-to-generator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
proposal-async-generator-functions { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
proposal-object-rest-spread { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
proposal-unicode-property-regex { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/stdout.txt
index 38e8356a3478..223ef746fda9 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/stdout.txt
index 5380e1c89aa6..9cee893f2a2e 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/stdout.txt
index efcedad873c6..ad6cde3c24aa 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/stdout.txt
@@ -41,7 +41,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "electron":"0.36", "ie":"10" }
transform-exponentiation-operator { "electron":"0.36", "ie":"10", "node":"6.1" }
- transform-async-to-generator { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
proposal-async-generator-functions { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
proposal-object-rest-spread { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
proposal-unicode-property-regex { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/stdout.txt
index af5f0f9ffe87..8d8cf7fe2333 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/stdout.txt
@@ -32,7 +32,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6.10" }
- transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-async-generator-functions { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-object-rest-spread { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6.10" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/stdout.txt
index c74e3e37cb55..31c21bace19c 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/stdout.txt
@@ -32,7 +32,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6.10" }
- transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-async-generator-functions { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-object-rest-spread { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6.10" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/stdout.txt
index caff30ef4984..74c154a2b26d 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/stdout.txt
@@ -32,7 +32,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6.10" }
- transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-async-generator-functions { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-object-rest-spread { "chrome":"54", "ie":"10", "node":"6.10" }
proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6.10" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/stdout.txt
index 9dea1a0f8905..d92ec30279e3 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/stdout.txt
index b337515f602d..a35cd149137c 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/stdout.txt
@@ -32,7 +32,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6" }
- transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6" }
proposal-async-generator-functions { "chrome":"54", "ie":"10", "node":"6" }
proposal-object-rest-spread { "chrome":"54", "ie":"10", "node":"6" }
proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stdout.txt
index 621161013483..e28519a1f6ad 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stdout.txt
@@ -28,7 +28,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-unicode-property-regex {}
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stdout.txt
index c773b35d1314..d051b5019f6b 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stdout.txt
@@ -33,7 +33,6 @@ Using plugins:
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
- transform-async-to-generator {}
proposal-async-generator-functions { "chrome":"55" }
proposal-object-rest-spread { "chrome":"55" }
proposal-unicode-property-regex { "chrome":"55" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stdout.txt
index b070fd82ae2c..596d823fbcd7 100644
--- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stdout.txt
@@ -32,7 +32,6 @@ Using plugins:
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6" }
- transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6" }
proposal-async-generator-functions { "chrome":"54", "ie":"10", "node":"6" }
proposal-object-rest-spread { "chrome":"54", "ie":"10", "node":"6" }
proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/stdout.txt
index 10a416642303..3a4742537bf8 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/stdout.txt
index c6bd456f09c6..7337bd97a95e 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/stdout.txt
index 83701579d0ee..f17969a7c09a 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/stdout.txt
index d0cc380462d3..0c1cce6bfe7d 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/stdout.txt
index f7f567c4c47a..54f7d2b6892c 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/stdout.txt
index 8f4c5e1df667..f251da3a1fb9 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/stdout.txt
index f456fc31c325..65b636097824 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/stdout.txt
index 14c735dcba8c..baea99e275f5 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/stdout.txt
index ce78b1615fa3..5420011af7ff 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/stdout.txt
index 4545ec9ddac5..51c71b8b36d6 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/stdout.txt
index 5effbeed1198..0cb836caf43e 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/stdout.txt
index 999084137006..0ca472fb637f 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/stdout.txt
index 4f5e93bc1d2a..a1c85b5f240b 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/stdout.txt
index c7b2d3da53a4..d21f014f1314 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/stdout.txt
index 3186c00e2458..56aa662832b0 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/stdout.txt
index ed270ec46b29..848d033d61be 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/stdout.txt
index 1fcbf70cef28..d7384c46888d 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/stdout.txt
index 1b7bf00896fb..3897ddf434ae 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/stdout.txt
index 7df78cdbe879..31bc70824f26 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/stdout.txt
index 2dba4464ffa8..29b751d07ae8 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stdout.txt
index 211854dc7a12..eb4cf5b632c2 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stdout.txt
index 90c9d87ef822..77a2227dde4e 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stdout.txt
index 6afbb5cd98f5..d2f78b1901c6 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stdout.txt
index 5d3445c8f14f..cc7e91a5d56d 100644
--- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stdout.txt
+++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stdout.txt
@@ -31,7 +31,6 @@ Using plugins:
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
- transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-async-generator-functions { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-object-rest-spread { "chrome":"52", "firefox":"50", "ie":"11" }
proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" }
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/input.js b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/input.js
new file mode 100644
index 000000000000..9604ae0250bb
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/input.js
@@ -0,0 +1 @@
+async function foo() {}
\ No newline at end of file
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/options.json b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/options.json
new file mode 100644
index 000000000000..41ee66e16cc0
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/options.json
@@ -0,0 +1,11 @@
+{
+ "plugins": [],
+ "presets": [
+ [
+ "../../../../lib",
+ {
+ "targets": { "chrome": "49" }
+ }
+ ]
+ ]
+}
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/output.js b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/output.js
new file mode 100644
index 000000000000..19684e4a4db3
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/output.js
@@ -0,0 +1,9 @@
+function foo() {
+ return regeneratorRuntime.async(function foo$(_context) {
+ while (1) switch (_context.prev = _context.next) {
+ case 0:
+ case "end":
+ return _context.stop();
+ }
+ });
+}
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/input.js b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/input.js
new file mode 100644
index 000000000000..9604ae0250bb
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/input.js
@@ -0,0 +1 @@
+async function foo() {}
\ No newline at end of file
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/options.json b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/options.json
new file mode 100644
index 000000000000..df56e583e65b
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/options.json
@@ -0,0 +1,11 @@
+{
+ "plugins": [],
+ "presets": [
+ [
+ "../../../../lib",
+ {
+ "targets": { "chrome": "50" }
+ }
+ ]
+ ]
+}
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/output.js b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/output.js
new file mode 100644
index 000000000000..d69b16f0660c
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/output.js
@@ -0,0 +1,12 @@
+function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
+
+function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
+
+function foo() {
+ return _foo.apply(this, arguments);
+}
+
+function _foo() {
+ _foo = _asyncToGenerator(function* () {});
+ return _foo.apply(this, arguments);
+}
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/input.js b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/input.js
new file mode 100644
index 000000000000..9604ae0250bb
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/input.js
@@ -0,0 +1 @@
+async function foo() {}
\ No newline at end of file
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/options.json b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/options.json
new file mode 100644
index 000000000000..d76f324a91bb
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/options.json
@@ -0,0 +1,11 @@
+{
+ "plugins": [],
+ "presets": [
+ [
+ "../../../../lib",
+ {
+ "targets": { "chrome": "54" }
+ }
+ ]
+ ]
+}
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/output.js b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/output.js
new file mode 100644
index 000000000000..d69b16f0660c
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/output.js
@@ -0,0 +1,12 @@
+function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
+
+function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
+
+function foo() {
+ return _foo.apply(this, arguments);
+}
+
+function _foo() {
+ _foo = _asyncToGenerator(function* () {});
+ return _foo.apply(this, arguments);
+}
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/input.js b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/input.js
new file mode 100644
index 000000000000..9604ae0250bb
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/input.js
@@ -0,0 +1 @@
+async function foo() {}
\ No newline at end of file
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/options.json b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/options.json
new file mode 100644
index 000000000000..c08a917cbc95
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/options.json
@@ -0,0 +1,11 @@
+{
+ "plugins": [],
+ "presets": [
+ [
+ "../../../../lib",
+ {
+ "targets": { "chrome": "55" }
+ }
+ ]
+ ]
+}
diff --git a/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/output.js b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/output.js
new file mode 100644
index 000000000000..f9df9686dd67
--- /dev/null
+++ b/packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/output.js
@@ -0,0 +1 @@
+async function foo() {}
From d25262ec4b57196f97a5169ceaba3b6145287163 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Tue, 5 Nov 2019 00:35:40 +0100
Subject: [PATCH 039/648] Correctly delegate .return() in async generator
(#10422)
* Correctly delegate .return() in async generator
* Add catch param
* minNodeVersion
* Add another test
---
packages/babel-helpers/src/helpers.js | 6 ++-
.../fixtures/yield-star/issue-9905/exec.js | 20 ++++++++++
.../yield-star/issue-9905/options.json | 3 ++
.../test/fixtures/yield-star/options.json | 10 +++++
.../exec.js | 34 +++++++++++++++++
.../options.json | 3 ++
.../exec.js | 37 +++++++++++++++++++
.../options.json | 3 ++
.../return-method-with-finally/exec.js | 37 +++++++++++++++++++
.../fixtures/yield-star/return-method/exec.js | 31 ++++++++++++++++
.../yield-star/return-method/options.json | 3 ++
.../throw-method-with-catch/exec.js | 37 +++++++++++++++++++
.../throw-method-with-finally/exec.js | 37 +++++++++++++++++++
.../generator-kinds/async-generator/output.js | 2 +-
.../corejs2/entry-shippedProposals/output.js | 2 +-
.../corejs2/usage-shippedProposals/output.js | 2 +-
.../preset-options/shippedProposals/output.js | 2 +-
17 files changed, 264 insertions(+), 5 deletions(-)
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/issue-9905/exec.js
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/issue-9905/options.json
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/options.json
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/exec.js
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/options.json
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/exec.js
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/options.json
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally/exec.js
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/exec.js
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/options.json
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/throw-method-with-catch/exec.js
create mode 100644 packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/throw-method-with-finally/exec.js
diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js
index 8fb04a895307..fadce7421815 100644
--- a/packages/babel-helpers/src/helpers.js
+++ b/packages/babel-helpers/src/helpers.js
@@ -136,7 +136,7 @@ helpers.AsyncGenerator = helper("7.0.0-beta.0")`
Promise.resolve(wrappedAwait ? value.wrapped : value).then(
function (arg) {
if (wrappedAwait) {
- resume("next", arg);
+ resume(key === "return" ? "return" : "next", arg);
return
}
@@ -238,6 +238,10 @@ helpers.asyncGeneratorDelegate = helper("7.0.0-beta.0")`
if (typeof inner.return === "function") {
iter.return = function (value) {
+ if (waiting) {
+ waiting = false;
+ return value;
+ }
return pump("return", value);
};
}
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/issue-9905/exec.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/issue-9905/exec.js
new file mode 100644
index 000000000000..a4bf16180e24
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/issue-9905/exec.js
@@ -0,0 +1,20 @@
+const log = [];
+
+async function* func1() {
+ log.push(1);
+ yield "a";
+ log.push(2);
+}
+
+async function* func2() {
+ yield* func1();
+ log.push(3);
+}
+
+return (async () => {
+ const iterator = func2();
+ await iterator.next();
+ await iterator.return();
+
+ expect(log).toEqual([1]);
+})();
\ No newline at end of file
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/issue-9905/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/issue-9905/options.json
new file mode 100644
index 000000000000..7edb6d2fc815
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/issue-9905/options.json
@@ -0,0 +1,3 @@
+{
+ "minNodeVersion": "8.0.0"
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/options.json
new file mode 100644
index 000000000000..b0483f766a07
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/options.json
@@ -0,0 +1,10 @@
+{
+ "parserOpts": {
+ "allowReturnOutsideFunction": true
+ },
+ "plugins": [
+ "external-helpers",
+ "transform-async-to-generator",
+ "proposal-async-generator-functions"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/exec.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/exec.js
new file mode 100644
index 000000000000..1c4ef15d5d06
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/exec.js
@@ -0,0 +1,34 @@
+const log = [];
+
+async function* inner() {
+ try {
+ log.push(1);
+ yield "a";
+ log.push(2);
+ yield "b";
+ log.push(3);
+ } finally {
+ log.push(4);
+ yield "c";
+ log.push(5);
+ }
+}
+
+async function* outer() {
+ log.push(6);
+ yield* inner();
+ log.push(7);
+}
+
+return (async () => {
+ const iterator = outer();
+
+ let res = await iterator.next();
+ expect(res).toEqual({ value: "a", done: false });
+ expect(log).toEqual([6, 1]);
+
+ const [res1, res2] = await Promise.all([ iterator.return("x"), iterator.return("y") ]);
+ expect(res1).toEqual({ value: "c", done: false });
+ expect(res2).toEqual({ value: "y", done: true });
+ expect(log).toEqual([6, 1, 4]);
+})();
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/options.json
new file mode 100644
index 000000000000..7edb6d2fc815
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/options.json
@@ -0,0 +1,3 @@
+{
+ "minNodeVersion": "8.0.0"
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/exec.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/exec.js
new file mode 100644
index 000000000000..84865ef6f3df
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/exec.js
@@ -0,0 +1,37 @@
+const log = [];
+
+async function* inner() {
+ try {
+ log.push(1);
+ yield "a";
+ log.push(2);
+ yield "b";
+ log.push(3);
+ } finally {
+ log.push(4);
+ yield "c";
+ log.push(5);
+ }
+}
+
+async function* outer() {
+ log.push(6);
+ yield* inner();
+ log.push(7);
+}
+
+return (async () => {
+ const iterator = outer();
+
+ let res = await iterator.next();
+ expect(res).toEqual({ value: "a", done: false });
+ expect(log).toEqual([6, 1]);
+
+ res = await iterator.return("x");
+ expect(res).toEqual({ value: "c", done: false });
+ expect(log).toEqual([6, 1, 4]);
+
+ res = await iterator.return("y");
+ expect(res).toEqual({ value: "y", done: true });
+ expect(log).toEqual([6, 1, 4]);
+})();
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/options.json
new file mode 100644
index 000000000000..7edb6d2fc815
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/options.json
@@ -0,0 +1,3 @@
+{
+ "minNodeVersion": "8.0.0"
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally/exec.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally/exec.js
new file mode 100644
index 000000000000..0ef1d454a19f
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally/exec.js
@@ -0,0 +1,37 @@
+const log = [];
+
+async function* inner() {
+ try {
+ log.push(1);
+ yield "a";
+ log.push(2);
+ yield "b";
+ log.push(3);
+ } finally {
+ log.push(4);
+ yield "c";
+ log.push(5);
+ }
+}
+
+async function* outer() {
+ log.push(6);
+ yield* inner();
+ log.push(7);
+}
+
+return (async () => {
+ const iterator = outer();
+
+ let res = await iterator.next();
+ expect(res).toEqual({ value: "a", done: false });
+ expect(log).toEqual([6, 1]);
+
+ res = await iterator.return();
+ expect(res).toEqual({ value: "c", done: false });
+ expect(log).toEqual([6, 1, 4]);
+
+ res = await iterator.next();
+ expect(res).toEqual({ value: undefined, done: true });
+ expect(log).toEqual([6, 1, 4, 5, 7]);
+})();
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/exec.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/exec.js
new file mode 100644
index 000000000000..73be9d85e495
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/exec.js
@@ -0,0 +1,31 @@
+const log = [];
+
+async function* inner() {
+ log.push(1);
+ yield "a";
+ log.push(2);
+ yield "b";
+ log.push(3);
+}
+
+async function* outer() {
+ log.push(4);
+ yield* inner();
+ log.push(5);
+}
+
+return (async () => {
+ const iterator = outer();
+
+ let res = await iterator.next();
+ expect(res).toEqual({ value: "a", done: false });
+ expect(log).toEqual([4, 1]);
+
+ res = await iterator.return();
+ expect(res).toEqual({ value: undefined, done: true });
+ expect(log).toEqual([4, 1]);
+
+ res = await iterator.next();
+ expect(res).toEqual({ value: undefined, done: true });
+ expect(log).toEqual([4, 1]);
+})();
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/options.json
new file mode 100644
index 000000000000..7edb6d2fc815
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/options.json
@@ -0,0 +1,3 @@
+{
+ "minNodeVersion": "8.0.0"
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/throw-method-with-catch/exec.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/throw-method-with-catch/exec.js
new file mode 100644
index 000000000000..0859ad463e00
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/throw-method-with-catch/exec.js
@@ -0,0 +1,37 @@
+const log = [];
+
+async function* inner() {
+ try {
+ log.push(1);
+ yield "a";
+ log.push(2);
+ yield "b";
+ log.push(3);
+ } catch (e) {
+ log.push(4);
+ yield "c";
+ log.push(5);
+ }
+}
+
+async function* outer() {
+ log.push(6);
+ yield* inner();
+ log.push(7);
+}
+
+return (async () => {
+ const iterator = outer();
+
+ let res = await iterator.next();
+ expect(res).toEqual({ value: "a", done: false });
+ expect(log).toEqual([6, 1]);
+
+ res = await iterator.throw(new Error("TEST"));
+ expect(res).toEqual({ value: "c", done: false });
+ expect(log).toEqual([6, 1, 4]);
+
+ res = await iterator.next();
+ expect(res).toEqual({ value: undefined, done: true });
+ expect(log).toEqual([6, 1, 4, 5, 7]);
+})();
diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/throw-method-with-finally/exec.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/throw-method-with-finally/exec.js
new file mode 100644
index 000000000000..425a00b33f80
--- /dev/null
+++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/throw-method-with-finally/exec.js
@@ -0,0 +1,37 @@
+const log = [];
+
+async function* inner() {
+ try {
+ log.push(1);
+ yield "a";
+ log.push(2);
+ yield "b";
+ log.push(3);
+ } finally {
+ log.push(4);
+ yield "c";
+ log.push(5);
+ }
+}
+
+async function* outer() {
+ log.push(6);
+ yield* inner();
+ log.push(7);
+}
+
+return (async () => {
+ const iterator = outer();
+
+ let res = await iterator.next();
+ expect(res).toEqual({ value: "a", done: false });
+ expect(log).toEqual([6, 1]);
+
+ res = await iterator.throw(new Error("TEST"));
+ expect(res).toEqual({ value: "c", done: false });
+ expect(log).toEqual([6, 1, 4]);
+
+ // "yield" in finally suspended the exception for one turn
+ await expect(iterator.next()).rejects.toThrow(/TEST/);
+ expect(log).toEqual([6, 1, 4, 5]);
+})();
diff --git a/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/async-generator/output.js b/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/async-generator/output.js
index a05d6843d84e..8bccb5d80c6c 100644
--- a/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/async-generator/output.js
+++ b/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/async-generator/output.js
@@ -4,7 +4,7 @@ function _awaitAsyncGenerator(value) { return new _AwaitValue(value); }
function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
-function _AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume("next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen.return !== "function") { this.return = undefined; } }
+function _AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume(key === "return" ? "return" : "next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen.return !== "function") { this.return = undefined; } }
if (typeof Symbol === "function" && Symbol.asyncIterator) { _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; }; }
diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-shippedProposals/output.js b/packages/babel-preset-env/test/fixtures/corejs2/entry-shippedProposals/output.js
index 6618653a758e..11efbf4cdb8d 100644
--- a/packages/babel-preset-env/test/fixtures/corejs2/entry-shippedProposals/output.js
+++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-shippedProposals/output.js
@@ -310,7 +310,7 @@ function _awaitAsyncGenerator(value) { return new _AwaitValue(value); }
function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
-function _AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume("next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen["return"] !== "function") { this["return"] = undefined; } }
+function _AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume(key === "return" ? "return" : "next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen["return"] !== "function") { this["return"] = undefined; } }
if (typeof Symbol === "function" && Symbol.asyncIterator) { _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; }; }
diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-shippedProposals/output.js b/packages/babel-preset-env/test/fixtures/corejs2/usage-shippedProposals/output.js
index 341d5845145e..02988151dce8 100644
--- a/packages/babel-preset-env/test/fixtures/corejs2/usage-shippedProposals/output.js
+++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-shippedProposals/output.js
@@ -42,7 +42,7 @@ function _awaitAsyncGenerator(value) { return new _AwaitValue(value); }
function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
-function _AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume("next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen["return"] !== "function") { this["return"] = undefined; } }
+function _AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume(key === "return" ? "return" : "next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen["return"] !== "function") { this["return"] = undefined; } }
if (typeof Symbol === "function" && Symbol.asyncIterator) { _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; }; }
diff --git a/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals/output.js b/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals/output.js
index 4719ee3716e8..358a6a1f78bb 100644
--- a/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals/output.js
+++ b/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals/output.js
@@ -12,7 +12,7 @@ function _awaitAsyncGenerator(value) { return new _AwaitValue(value); }
function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
-function _AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume("next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen["return"] !== "function") { this["return"] = undefined; } }
+function _AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; var wrappedAwait = value instanceof _AwaitValue; Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { if (wrappedAwait) { resume(key === "return" ? "return" : "next", arg); return; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen["return"] !== "function") { this["return"] = undefined; } }
if (typeof Symbol === "function" && Symbol.asyncIterator) { _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; }; }
From 87feda7c2a33b7bde6dc926ced4dd741a90cc860 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Tue, 5 Nov 2019 10:15:00 +0100
Subject: [PATCH 040/648] @babel/parser error recovery (#10363)
* Add error recovery support to @babel/parser
* Update @babel/parser tests to always recover from errors
* Update this.raise usage in @babel/parser:
- expression.js
- lval.js
- statement.js
- estree.js
- flow.js
- jsx/index.js
- tokenizer/index.js
* Update @babel/parser fixtures with recovered errors
* Fix tests out of @babel/parser
* Do not use try/catch for control flow
* Update invalid fixtures
* Do not report invalid lhs in toAssignable
* Do not validate function id multiple times
* Dedupe reserved await errors
* Remove duplicate errors about strict reserved bindings
* Remove duplicated error about yield/await inside params
* Don't error twice for methods in object patterns
* Don't report invalid super() twice
* Remove dup error about reserved param for expr arrows
* Remove double escapes in migrated tests
* Dedupe errors about invalid escapes in identifiers
* Remove duplicated error about decorated constructor
* Remove duplicated error about spread in flow class
* Don't throw for invalid super usage
* Don't fail for object decorators with stage 2
* Fix flow inexact type errors
* Fix flow
* Fix errors about escapes in keywords (ref: #10455)
* Update after rebase
* Fix todo
* Remove duplicated error when using += for defaults
* Remove unnecessary throw
* Nit: use ??
---
.../test/fixtures/parse/output.json | 1 +
packages/babel-parser/src/options.js | 4 +
.../babel-parser/src/parser/expression.js | 138 +++--
packages/babel-parser/src/parser/index.js | 5 +-
packages/babel-parser/src/parser/location.js | 12 +-
packages/babel-parser/src/parser/lval.js | 42 +-
packages/babel-parser/src/parser/statement.js | 44 +-
packages/babel-parser/src/parser/util.js | 63 ++
packages/babel-parser/src/plugins/estree.js | 14 +-
packages/babel-parser/src/plugins/flow.js | 488 ++++++++-------
.../babel-parser/src/plugins/jsx/index.js | 17 +-
.../src/plugins/typescript/index.js | 192 +++---
packages/babel-parser/src/tokenizer/index.js | 113 ++--
packages/babel-parser/src/tokenizer/state.js | 2 +
packages/babel-parser/src/util/identifier.js | 16 +-
.../fail/7/options.json | 3 -
.../fail/7/output.json | 128 ++++
.../fail/8/options.json | 5 +-
.../fail/8/output.json | 20 +
.../invalid-fn-decl-inside-loop/options.json | 3 -
.../invalid-fn-decl-inside-loop/output.json | 125 ++++
.../options.json | 3 -
.../output.json | 189 ++++++
.../core/escape-keyword/invalid/options.json | 3 -
.../core/escape-keyword/invalid/output.json | 160 +++++
.../non-octal-eight/options.json | 3 -
.../non-octal-eight/output.json | 91 +++
.../non-octal-nine/options.json | 3 -
.../non-octal-nine/output.json | 91 +++
.../non-octal-float-strict-mode/options.json | 5 +-
.../non-octal-float-strict-mode/output.json | 73 +++
.../dupl-bind-2nd-lvl-lex-nested/options.json | 3 -
.../dupl-bind-2nd-lvl-lex-nested/output.json | 247 ++++++++
.../scope/dupl-bind-2nd-lvl-lex/options.json | 3 -
.../scope/dupl-bind-2nd-lvl-lex/output.json | 229 ++++++++
.../dupl-bind-2nd-lvl-var-nested/options.json | 3 -
.../dupl-bind-2nd-lvl-var-nested/output.json | 247 ++++++++
.../scope/dupl-bind-2nd-lvl-var/options.json | 3 -
.../scope/dupl-bind-2nd-lvl-var/output.json | 229 ++++++++
.../dupl-bind-catch-arr-destr/options.json | 3 -
.../dupl-bind-catch-arr-destr/output.json | 154 +++++
.../dupl-bind-catch-dbl-let/options.json | 3 -
.../scope/dupl-bind-catch-dbl-let/output.json | 222 +++++++
.../scope/dupl-bind-catch-func/options.json | 3 -
.../scope/dupl-bind-catch-func/output.json | 173 ++++++
.../scope/dupl-bind-catch-let/options.json | 3 -
.../scope/dupl-bind-catch-let/output.json | 172 ++++++
.../dupl-bind-catch-obj-destr/options.json | 3 -
.../dupl-bind-catch-obj-destr/output.json | 293 +++++++++
.../options.json | 3 -
.../dupl-bind-catch-var-arr-destr/output.json | 189 ++++++
.../options.json | 3 -
.../dupl-bind-catch-var-obj-destr/output.json | 227 +++++++
.../scope/dupl-bind-class-class/options.json | 3 -
.../scope/dupl-bind-class-class/output.json | 166 ++++++
.../scope/dupl-bind-class-const/options.json | 3 -
.../scope/dupl-bind-class-const/output.json | 172 ++++++
.../scope/dupl-bind-class-func/options.json | 3 -
.../scope/dupl-bind-class-func/output.json | 169 ++++++
.../scope/dupl-bind-class-let/options.json | 3 -
.../scope/dupl-bind-class-let/output.json | 172 ++++++
.../scope/dupl-bind-class-var/options.json | 3 -
.../scope/dupl-bind-class-var/output.json | 153 +++++
.../scope/dupl-bind-const-const/options.json | 3 -
.../scope/dupl-bind-const-const/output.json | 160 +++++
.../scope/dupl-bind-func-gen/options.json | 3 -
.../core/scope/dupl-bind-func-gen/output.json | 160 +++++
.../dupl-bind-func-module-sloppy/options.json | 5 +-
.../dupl-bind-func-module-sloppy/output.json | 160 +++++
.../scope/dupl-bind-func-module/options.json | 5 +-
.../scope/dupl-bind-func-module/output.json | 142 +++++
.../dupl-bind-func-var-sloppy/options.json | 3 -
.../dupl-bind-func-var-sloppy/output.json | 178 ++++++
.../scope/dupl-bind-gen-func/options.json | 3 -
.../core/scope/dupl-bind-gen-func/output.json | 160 +++++
.../core/scope/dupl-bind-let-let/options.json | 3 -
.../core/scope/dupl-bind-let-let/output.json | 122 ++++
.../dupl-bind-nested-let-var/options.json | 3 -
.../dupl-bind-nested-let-var/output.json | 176 ++++++
.../fixtures/core/scope/for-var/options.json | 3 -
.../fixtures/core/scope/for-var/output.json | 194 ++++++
.../undecl-export-as-default/options.json | 5 +-
.../undecl-export-as-default/output.json | 106 ++++
.../core/scope/undecl-export-as/options.json | 5 +-
.../core/scope/undecl-export-as/output.json | 158 +++++
.../scope/undecl-export-block/options.json | 5 +-
.../scope/undecl-export-block/output.json | 176 ++++++
.../undecl-export-builtin-as/options.json | 5 +-
.../undecl-export-builtin-as/output.json | 106 ++++
.../scope/undecl-export-builtin/options.json | 5 +-
.../scope/undecl-export-builtin/output.json | 106 ++++
.../core/scope/undecl-export-if/options.json | 5 +-
.../core/scope/undecl-export-if/output.json | 191 ++++++
.../core/scope/undecl-export/options.json | 5 +-
.../core/scope/undecl-export/output.json | 106 ++++
.../core/uncategorised/108/options.json | 3 -
.../core/uncategorised/108/output.json | 112 ++++
.../core/uncategorised/347/options.json | 4 +-
.../core/uncategorised/349/options.json | 3 -
.../core/uncategorised/349/output.json | 73 +++
.../core/uncategorised/350/options.json | 3 -
.../core/uncategorised/350/output.json | 73 +++
.../core/uncategorised/351/options.json | 3 -
.../core/uncategorised/351/output.json | 73 +++
.../core/uncategorised/354/options.json | 3 -
.../core/uncategorised/354/output.json | 73 +++
.../core/uncategorised/361/options.json | 3 -
.../core/uncategorised/361/output.json | 70 +++
.../core/uncategorised/362/options.json | 3 -
.../core/uncategorised/362/output.json | 70 +++
.../core/uncategorised/363/options.json | 3 -
.../core/uncategorised/363/output.json | 70 +++
.../core/uncategorised/366/options.json | 3 -
.../core/uncategorised/366/output.json | 109 ++++
.../core/uncategorised/367/options.json | 3 -
.../core/uncategorised/367/output.json | 109 ++++
.../core/uncategorised/368/options.json | 3 -
.../core/uncategorised/368/output.json | 122 ++++
.../core/uncategorised/369/options.json | 3 -
.../core/uncategorised/369/output.json | 149 +++++
.../core/uncategorised/370/options.json | 3 -
.../core/uncategorised/370/output.json | 90 +++
.../core/uncategorised/371/options.json | 3 -
.../core/uncategorised/371/output.json | 90 +++
.../core/uncategorised/372/options.json | 3 -
.../core/uncategorised/372/output.json | 90 +++
.../core/uncategorised/373/options.json | 3 -
.../core/uncategorised/373/output.json | 90 +++
.../core/uncategorised/374/options.json | 3 -
.../core/uncategorised/374/output.json | 196 ++++++
.../core/uncategorised/382/options.json | 3 -
.../core/uncategorised/382/output.json | 108 ++++
.../core/uncategorised/383/options.json | 3 -
.../core/uncategorised/383/output.json | 142 +++++
.../core/uncategorised/384/options.json | 3 -
.../core/uncategorised/384/output.json | 123 ++++
.../core/uncategorised/397/options.json | 3 -
.../core/uncategorised/397/output.json | 108 ++++
.../core/uncategorised/398/options.json | 3 -
.../core/uncategorised/398/output.json | 108 ++++
.../core/uncategorised/399/options.json | 3 -
.../core/uncategorised/399/output.json | 108 ++++
.../core/uncategorised/400/options.json | 3 -
.../core/uncategorised/400/output.json | 108 ++++
.../core/uncategorised/401/options.json | 3 -
.../core/uncategorised/401/output.json | 90 +++
.../core/uncategorised/402/options.json | 3 -
.../core/uncategorised/402/output.json | 90 +++
.../core/uncategorised/403/options.json | 3 -
.../core/uncategorised/403/output.json | 90 +++
.../core/uncategorised/404/options.json | 3 -
.../core/uncategorised/404/output.json | 90 +++
.../core/uncategorised/409/options.json | 3 -
.../core/uncategorised/409/output.json | 54 ++
.../core/uncategorised/411/options.json | 3 -
.../core/uncategorised/411/output.json | 54 ++
.../core/uncategorised/417/options.json | 3 -
.../core/uncategorised/417/output.json | 137 +++++
.../core/uncategorised/418/options.json | 3 -
.../core/uncategorised/418/output.json | 118 ++++
.../core/uncategorised/425/options.json | 3 -
.../core/uncategorised/425/output.json | 72 +++
.../core/uncategorised/427/options.json | 3 -
.../core/uncategorised/427/output.json | 106 ++++
.../core/uncategorised/446/options.json | 3 -
.../core/uncategorised/446/output.json | 71 +++
.../core/uncategorised/447/options.json | 3 -
.../core/uncategorised/447/output.json | 70 +++
.../core/uncategorised/448/options.json | 3 -
.../core/uncategorised/448/output.json | 70 +++
.../core/uncategorised/449/options.json | 3 -
.../core/uncategorised/449/output.json | 70 +++
.../core/uncategorised/453/options.json | 4 +-
.../core/uncategorised/454/options.json | 3 -
.../core/uncategorised/454/output.json | 54 ++
.../core/uncategorised/455/options.json | 3 -
.../core/uncategorised/455/output.json | 54 ++
.../core/uncategorised/456/options.json | 3 -
.../core/uncategorised/456/output.json | 54 ++
.../core/uncategorised/457/options.json | 3 -
.../core/uncategorised/457/output.json | 106 ++++
.../core/uncategorised/459/options.json | 3 -
.../core/uncategorised/459/output.json | 119 ++++
.../core/uncategorised/460/options.json | 3 -
.../core/uncategorised/460/output.json | 119 ++++
.../core/uncategorised/461/options.json | 3 -
.../core/uncategorised/461/output.json | 207 +++++++
.../core/uncategorised/462/options.json | 3 -
.../core/uncategorised/462/output.json | 207 +++++++
.../core/uncategorised/463/options.json | 3 -
.../core/uncategorised/463/output.json | 191 ++++++
.../core/uncategorised/464/options.json | 3 -
.../core/uncategorised/464/output.json | 191 ++++++
.../core/uncategorised/465/options.json | 3 -
.../core/uncategorised/465/output.json | 199 +++++++
.../core/uncategorised/466/options.json | 3 -
.../core/uncategorised/466/output.json | 195 ++++++
.../core/uncategorised/467/options.json | 3 -
.../core/uncategorised/467/output.json | 193 ++++++
.../core/uncategorised/468/options.json | 3 -
.../core/uncategorised/468/output.json | 197 +++++++
.../core/uncategorised/469/options.json | 3 -
.../core/uncategorised/469/output.json | 197 +++++++
.../core/uncategorised/470/options.json | 3 -
.../core/uncategorised/470/output.json | 209 +++++++
.../core/uncategorised/471/options.json | 3 -
.../core/uncategorised/471/output.json | 209 +++++++
.../core/uncategorised/472/options.json | 3 -
.../core/uncategorised/472/output.json | 195 ++++++
.../core/uncategorised/473/options.json | 3 -
.../core/uncategorised/473/output.json | 195 ++++++
.../core/uncategorised/474/options.json | 3 -
.../core/uncategorised/474/output.json | 176 ++++++
.../core/uncategorised/475/options.json | 3 -
.../core/uncategorised/475/output.json | 176 ++++++
.../core/uncategorised/476/options.json | 3 -
.../core/uncategorised/476/output.json | 176 ++++++
.../core/uncategorised/477/options.json | 3 -
.../core/uncategorised/477/output.json | 176 ++++++
.../core/uncategorised/478/options.json | 3 -
.../core/uncategorised/478/output.json | 176 ++++++
.../core/uncategorised/479/options.json | 3 -
.../core/uncategorised/479/output.json | 176 ++++++
.../core/uncategorised/480/options.json | 3 -
.../core/uncategorised/480/output.json | 176 ++++++
.../core/uncategorised/481/options.json | 3 -
.../core/uncategorised/481/output.json | 176 ++++++
.../core/uncategorised/482/options.json | 3 -
.../core/uncategorised/482/output.json | 179 ++++++
.../core/uncategorised/483/options.json | 3 -
.../core/uncategorised/483/output.json | 179 ++++++
.../core/uncategorised/484/options.json | 3 -
.../core/uncategorised/484/output.json | 126 ++++
.../core/uncategorised/485/options.json | 3 -
.../core/uncategorised/485/output.json | 126 ++++
.../core/uncategorised/486/options.json | 3 -
.../core/uncategorised/486/output.json | 214 +++++++
.../core/uncategorised/487/options.json | 3 -
.../core/uncategorised/487/output.json | 214 +++++++
.../core/uncategorised/488/options.json | 3 -
.../core/uncategorised/488/output.json | 161 +++++
.../core/uncategorised/489/options.json | 3 -
.../core/uncategorised/489/output.json | 161 +++++
.../core/uncategorised/490/options.json | 3 -
.../core/uncategorised/490/output.json | 250 ++++++++
.../core/uncategorised/491/options.json | 3 -
.../core/uncategorised/491/output.json | 161 +++++
.../core/uncategorised/492/options.json | 3 -
.../core/uncategorised/492/output.json | 292 +++++++++
.../core/uncategorised/493/options.json | 3 -
.../core/uncategorised/493/output.json | 237 ++++++++
.../core/uncategorised/494/options.json | 3 -
.../core/uncategorised/494/output.json | 268 +++++++++
.../core/uncategorised/495/options.json | 3 -
.../core/uncategorised/495/output.json | 144 +++++
.../core/uncategorised/496/options.json | 3 -
.../core/uncategorised/496/output.json | 144 +++++
.../core/uncategorised/497/options.json | 3 -
.../core/uncategorised/497/output.json | 197 +++++++
.../core/uncategorised/498/options.json | 3 -
.../core/uncategorised/498/output.json | 197 +++++++
.../core/uncategorised/499/options.json | 3 -
.../core/uncategorised/499/output.json | 162 +++++
.../core/uncategorised/500/options.json | 3 -
.../core/uncategorised/500/output.json | 163 +++++
.../core/uncategorised/501/options.json | 3 -
.../core/uncategorised/501/output.json | 221 +++++++
.../core/uncategorised/502/options.json | 3 -
.../core/uncategorised/502/output.json | 221 +++++++
.../core/uncategorised/503/options.json | 3 -
.../core/uncategorised/503/output.json | 215 +++++++
.../core/uncategorised/504/options.json | 3 -
.../core/uncategorised/504/output.json | 178 ++++++
.../core/uncategorised/505/options.json | 3 -
.../core/uncategorised/505/output.json | 178 ++++++
.../core/uncategorised/506/options.json | 3 -
.../core/uncategorised/506/output.json | 178 ++++++
.../core/uncategorised/507/options.json | 3 -
.../core/uncategorised/507/output.json | 178 ++++++
.../core/uncategorised/508/options.json | 3 -
.../core/uncategorised/508/output.json | 178 ++++++
.../core/uncategorised/509/options.json | 3 -
.../core/uncategorised/509/output.json | 178 ++++++
.../core/uncategorised/510/options.json | 3 -
.../core/uncategorised/510/output.json | 178 ++++++
.../core/uncategorised/511/options.json | 3 -
.../core/uncategorised/511/output.json | 144 +++++
.../core/uncategorised/512/options.json | 3 -
.../core/uncategorised/512/output.json | 126 ++++
.../core/uncategorised/513/options.json | 3 -
.../core/uncategorised/513/output.json | 126 ++++
.../core/uncategorised/514/options.json | 3 -
.../core/uncategorised/514/output.json | 161 +++++
.../core/uncategorised/515/options.json | 3 -
.../core/uncategorised/515/output.json | 144 +++++
.../core/uncategorised/516/options.json | 3 -
.../core/uncategorised/516/output.json | 144 +++++
.../core/uncategorised/517/options.json | 3 -
.../core/uncategorised/517/output.json | 229 ++++++++
.../core/uncategorised/518/options.json | 3 -
.../core/uncategorised/518/output.json | 180 ++++++
.../core/uncategorised/519/options.json | 3 -
.../core/uncategorised/519/output.json | 233 ++++++++
.../core/uncategorised/520/options.json | 3 -
.../core/uncategorised/520/output.json | 163 +++++
.../core/uncategorised/521/options.json | 3 -
.../core/uncategorised/521/output.json | 163 +++++
.../core/uncategorised/522/options.json | 3 -
.../core/uncategorised/522/output.json | 285 +++++++++
.../core/uncategorised/523/options.json | 3 -
.../core/uncategorised/523/output.json | 108 ++++
.../core/uncategorised/524/options.json | 3 -
.../core/uncategorised/524/output.json | 73 +++
.../core/uncategorised/544/options.json | 3 -
.../core/uncategorised/544/output.json | 212 +++++++
.../core/uncategorised/545/options.json | 5 +-
.../core/uncategorised/545/output.json | 176 ++++++
.../core/uncategorised/547/options.json | 3 -
.../core/uncategorised/547/output.json | 213 +++++++
.../core/uncategorised/548/options.json | 5 +-
.../core/uncategorised/548/output.json | 177 ++++++
.../core/uncategorised/550/options.json | 3 -
.../core/uncategorised/550/output.json | 144 +++++
.../core/uncategorised/552/options.json | 3 -
.../core/uncategorised/552/output.json | 144 +++++
.../core/uncategorised/556/options.json | 5 +-
.../core/uncategorised/556/output.json | 228 +++++++
.../core/uncategorised/558/options.json | 5 +-
.../core/uncategorised/558/output.json | 134 +++++
.../comma-after-rest/options.json | 3 -
.../comma-after-rest/output.json | 137 +++++
.../comma-after-spread-for-in/options.json | 3 -
.../comma-after-spread-for-in/output.json | 136 +++++
.../comma-after-spread-nested/options.json | 3 -
.../comma-after-spread-nested/output.json | 154 +++++
.../comma-after-rest-param/options.json | 4 +-
.../options.json | 3 -
.../direct-super-in-object-method/output.json | 340 +++++++++++
.../options.json | 3 -
.../output.json | 191 ++++++
.../options.json | 3 -
.../output.json | 179 ++++++
.../options.json | 3 -
.../output.json | 144 +++++
.../disallow-static-prototype/options.json | 3 -
.../disallow-static-prototype/output.json | 144 +++++
.../getter-signature/options.json | 3 -
.../getter-signature/output.json | 162 +++++
.../malformed-super-expression/options.json | 3 -
.../malformed-super-expression/output.json | 211 +++++++
.../es2015/class/extends-strict/options.json | 3 -
.../es2015/class/extends-strict/output.json | 237 ++++++++
.../destructuring/binding-this/input.js | 2 +-
.../destructuring/binding-this/options.json | 3 -
.../destructuring/binding-this/output.json | 159 +++++
.../error-operator-for-default/options.json | 3 -
.../error-operator-for-default/output.json | 156 +++++
.../parenthesized-lhs-array/options.json | 3 -
.../parenthesized-lhs-array/output.json | 127 ++++
.../parenthesized-lhs-object/options.json | 3 -
.../parenthesized-lhs-object/output.json | 165 ++++++
.../for-in/bare-initializer/options.json | 3 -
.../for-in/bare-initializer/output.json | 187 ++++++
.../for-in/const-initializer/options.json | 3 -
.../for-in/const-initializer/output.json | 154 +++++
.../for-in/let-initializer/options.json | 3 -
.../es2015/for-in/let-initializer/output.json | 154 +++++
.../for-in/strict-initializer/options.json | 3 -
.../for-in/strict-initializer/output.json | 190 ++++++
.../options.json | 3 -
.../output.json | 171 ++++++
.../options.json | 3 -
.../output.json | 209 +++++++
.../for-of/bare-initializer/options.json | 3 -
.../for-of/bare-initializer/output.json | 188 ++++++
.../generators/invalid-escape-yield/input.js | 2 +-
.../invalid-escape-yield/options.json | 3 -
.../invalid-escape-yield/output.json | 126 ++++
.../generators/invalid-hanging/options.json | 3 -
.../generators/invalid-hanging/output.json | 126 ++++
.../invalid-escape-seq-const/input.js | 2 +
.../invalid-escape-seq-const/options.json | 3 -
.../invalid-escape-seq-const/output.json | 180 ++++++
.../invalid-escape-seq-export/input.js | 3 +
.../invalid-escape-seq-export/options.json | 4 +-
.../invalid-escape-seq-export/output.json | 229 ++++++++
.../invalid-escape-seq-if/options.json | 3 -
.../invalid-escape-seq-if/output.json | 87 +++
.../invalid-escape-seq-import/input.js | 2 +
.../invalid-escape-seq-import/options.json | 4 +-
.../invalid-escape-seq-import/output.json | 146 +++++
.../invalid-escape-seq-null/options.json | 3 -
.../invalid-escape-seq-null/output.json | 68 +++
.../invalid-escape-seq-true/options.json | 3 -
.../invalid-escape-seq-true/output.json | 69 +++
.../options.json | 3 -
.../let-as-identifier-strict-fail/output.json | 142 +++++
.../let-at-binding-list-fail-1/options.json | 3 -
.../let-at-binding-list-fail-1/output.json | 159 +++++
.../let-at-binding-list-fail-2/options.json | 3 -
.../let-at-binding-list-fail-2/output.json | 159 +++++
.../let-at-binding-list-fail-3/options.json | 3 -
.../let-at-binding-list-fail-3/output.json | 121 ++++
.../let-at-binding-list-fail-4/options.json | 3 -
.../let-at-binding-list-fail-4/output.json | 121 ++++
.../let-at-binding-list-fail-5/options.json | 3 -
.../let-at-binding-list-fail-5/output.json | 89 +++
.../let-at-binding-list-fail-6/options.json | 3 -
.../let-at-binding-list-fail-6/output.json | 108 ++++
.../let/let-at-catch-block/options.json | 3 -
.../es2015/let/let-at-catch-block/output.json | 172 ++++++
.../invalid-arrow-function/options.json | 3 -
.../invalid-arrow-function/output.json | 189 ++++++
.../meta-properties/new-invalid-prop/input.js | 4 +-
.../new-invalid-prop/options.json | 3 -
.../new-invalid-prop/output.json | 155 +++++
.../options.json | 3 -
.../output.json | 155 +++++
.../options.json | 3 -
.../output.json | 155 +++++
.../new-target-invalid/options.json | 3 -
.../new-target-invalid/output.json | 102 ++++
.../options.json | 4 +-
.../output.json | 173 ++++++
.../duplicate-export-default/options.json | 4 +-
.../duplicate-export-default/output.json | 135 +++++
.../options.json | 4 +-
.../output.json | 187 ++++++
.../options.json | 5 +-
.../output.json | 280 +++++++++
.../options.json | 3 -
.../output.json | 331 +++++++++++
.../options.json | 3 -
.../output.json | 521 ++++++++++++++++
.../options.json | 3 -
.../output.json | 504 ++++++++++++++++
.../options.json | 3 -
.../output.json | 556 ++++++++++++++++++
.../options.json | 3 -
.../output.json | 262 +++++++++
.../options.json | 3 -
.../output.json | 262 +++++++++
.../options.json | 3 -
.../output.json | 259 ++++++++
.../options.json | 3 -
.../output.json | 259 ++++++++
.../options.json | 3 -
.../output.json | 293 +++++++++
.../options.json | 3 -
.../output.json | 311 ++++++++++
.../options.json | 3 -
.../output.json | 262 +++++++++
.../options.json | 3 -
.../output.json | 262 +++++++++
.../options.json | 3 -
.../output.json | 224 +++++++
.../options.json | 3 -
.../output.json | 224 +++++++
.../options.json | 3 -
.../output.json | 279 +++++++++
.../options.json | 3 -
.../output.json | 279 +++++++++
.../options.json | 3 -
.../output.json | 259 ++++++++
.../options.json | 3 -
.../output.json | 221 +++++++
.../options.json | 4 +-
.../output.json | 190 ++++++
.../options.json | 4 +-
.../output.json | 190 ++++++
.../duplicate-named-export/options.json | 4 +-
.../duplicate-named-export/output.json | 176 ++++++
.../import-invalid-keyword-flow/options.json | 8 +-
.../import-invalid-keyword-flow/output.json | 126 ++++
.../options.json | 8 +-
.../output.json | 126 ++++
.../options.json | 4 +-
.../import-invalid-keyword-typeof/output.json | 124 ++++
.../import-invalid-keyword/options.json | 4 +-
.../import-invalid-keyword/output.json | 124 ++++
.../options.json | 3 -
.../output.json | 165 ++++++
.../es2015/regex/duplicate-flags/options.json | 3 -
.../es2015/regex/duplicate-flags/output.json | 73 +++
.../fixtures/es2015/shorthand/1/options.json | 3 -
.../fixtures/es2015/shorthand/1/output.json | 164 ++++++
.../fixtures/es2015/shorthand/2/options.json | 3 -
.../fixtures/es2015/shorthand/2/output.json | 240 ++++++++
.../label-invalid-const/options.json | 3 -
.../label-invalid-const/output.json | 135 +++++
.../label-invalid-func-async/options.json | 3 -
.../label-invalid-func-async/output.json | 122 ++++
.../label-invalid-func-generator/options.json | 3 -
.../label-invalid-func-generator/output.json | 122 ++++
.../label-invalid-func-strict/options.json | 3 -
.../label-invalid-func-strict/output.json | 211 +++++++
.../es2015/uncategorised/109/options.json | 3 -
.../es2015/uncategorised/109/output.json | 207 +++++++
.../es2015/uncategorised/123/options.json | 3 -
.../es2015/uncategorised/123/output.json | 246 ++++++++
.../es2015/uncategorised/125/input.js | 2 +-
.../es2015/uncategorised/125/options.json | 3 -
.../es2015/uncategorised/125/output.json | 203 +++++++
.../es2015/uncategorised/126/options.json | 3 -
.../es2015/uncategorised/126/output.json | 144 +++++
.../es2015/uncategorised/127/options.json | 3 -
.../es2015/uncategorised/127/output.json | 144 +++++
.../es2015/uncategorised/166/options.json | 3 -
.../es2015/uncategorised/166/output.json | 180 ++++++
.../es2015/uncategorised/198/options.json | 3 -
.../es2015/uncategorised/198/output.json | 73 +++
.../es2015/uncategorised/200/options.json | 3 -
.../es2015/uncategorised/200/output.json | 73 +++
.../es2015/uncategorised/201/options.json | 3 -
.../es2015/uncategorised/201/output.json | 73 +++
.../es2015/uncategorised/202/options.json | 3 -
.../es2015/uncategorised/202/output.json | 73 +++
.../es2015/uncategorised/204/options.json | 3 -
.../es2015/uncategorised/204/output.json | 73 +++
.../es2015/uncategorised/205/options.json | 3 -
.../es2015/uncategorised/205/output.json | 73 +++
.../es2015/uncategorised/206/options.json | 3 -
.../es2015/uncategorised/206/output.json | 73 +++
.../es2015/uncategorised/208/options.json | 3 -
.../es2015/uncategorised/208/output.json | 73 +++
.../es2015/uncategorised/209/options.json | 3 -
.../es2015/uncategorised/209/output.json | 73 +++
.../es2015/uncategorised/210/options.json | 3 -
.../es2015/uncategorised/210/output.json | 73 +++
.../es2015/uncategorised/211/options.json | 3 -
.../es2015/uncategorised/211/output.json | 73 +++
.../es2015/uncategorised/213/options.json | 3 -
.../es2015/uncategorised/213/output.json | 73 +++
.../es2015/uncategorised/214/options.json | 3 -
.../es2015/uncategorised/214/output.json | 73 +++
.../es2015/uncategorised/215/options.json | 3 -
.../es2015/uncategorised/215/output.json | 73 +++
.../es2015/uncategorised/216/options.json | 4 +-
.../es2015/uncategorised/217/options.json | 3 -
.../es2015/uncategorised/217/output.json | 73 +++
.../es2015/uncategorised/218/options.json | 3 -
.../es2015/uncategorised/218/output.json | 73 +++
.../es2015/uncategorised/219/options.json | 3 -
.../es2015/uncategorised/219/output.json | 73 +++
.../es2015/uncategorised/220/options.json | 3 -
.../es2015/uncategorised/220/output.json | 120 ++++
.../es2015/uncategorised/221/options.json | 3 -
.../es2015/uncategorised/221/output.json | 126 ++++
.../es2015/uncategorised/222/input.js | 2 +-
.../es2015/uncategorised/222/options.json | 3 -
.../es2015/uncategorised/222/output.json | 165 ++++++
.../es2015/uncategorised/223/input.js | 2 +-
.../es2015/uncategorised/223/options.json | 3 -
.../es2015/uncategorised/223/output.json | 166 ++++++
.../es2015/uncategorised/226/options.json | 3 -
.../es2015/uncategorised/226/output.json | 90 +++
.../es2015/uncategorised/227/options.json | 3 -
.../es2015/uncategorised/227/output.json | 292 +++++++++
.../es2015/uncategorised/228/options.json | 3 -
.../es2015/uncategorised/228/output.json | 254 ++++++++
.../es2015/uncategorised/229/options.json | 3 -
.../es2015/uncategorised/229/output.json | 89 +++
.../es2015/uncategorised/230/options.json | 3 -
.../es2015/uncategorised/230/output.json | 89 +++
.../es2015/uncategorised/231/options.json | 3 -
.../es2015/uncategorised/231/output.json | 89 +++
.../es2015/uncategorised/232/input.js | 2 +-
.../es2015/uncategorised/232/options.json | 3 -
.../es2015/uncategorised/232/output.json | 108 ++++
.../es2015/uncategorised/233/input.js | 2 +-
.../es2015/uncategorised/233/options.json | 3 -
.../es2015/uncategorised/233/output.json | 195 ++++++
.../es2015/uncategorised/234/input.js | 2 +-
.../es2015/uncategorised/234/options.json | 3 -
.../es2015/uncategorised/234/output.json | 195 ++++++
.../es2015/uncategorised/235/options.json | 3 -
.../es2015/uncategorised/235/output.json | 206 +++++++
.../es2015/uncategorised/236/options.json | 3 -
.../es2015/uncategorised/236/output.json | 207 +++++++
.../es2015/uncategorised/242/options.json | 3 -
.../es2015/uncategorised/242/output.json | 182 ++++++
.../es2015/uncategorised/243/options.json | 3 -
.../es2015/uncategorised/243/output.json | 146 +++++
.../es2015/uncategorised/244/options.json | 3 -
.../es2015/uncategorised/244/output.json | 146 +++++
.../es2015/uncategorised/245/options.json | 3 -
.../es2015/uncategorised/245/output.json | 163 +++++
.../es2015/uncategorised/246/options.json | 3 -
.../es2015/uncategorised/246/output.json | 163 +++++
.../es2015/uncategorised/247/options.json | 3 -
.../es2015/uncategorised/247/output.json | 198 +++++++
.../es2015/uncategorised/248/options.json | 3 -
.../es2015/uncategorised/248/output.json | 163 +++++
.../es2015/uncategorised/249/options.json | 3 -
.../es2015/uncategorised/249/output.json | 146 +++++
.../es2015/uncategorised/251/options.json | 3 -
.../es2015/uncategorised/251/output.json | 113 ++++
.../es2015/uncategorised/252/options.json | 3 -
.../es2015/uncategorised/252/output.json | 134 +++++
.../es2015/uncategorised/280/options.json | 3 -
.../es2015/uncategorised/280/output.json | 216 +++++++
.../es2015/uncategorised/281/options.json | 3 -
.../es2015/uncategorised/281/output.json | 392 ++++++++++++
.../es2015/uncategorised/284/options.json | 3 -
.../es2015/uncategorised/284/output.json | 127 ++++
.../es2015/uncategorised/289/options.json | 3 -
.../es2015/uncategorised/289/output.json | 184 ++++++
.../es2015/uncategorised/290/options.json | 3 -
.../es2015/uncategorised/290/output.json | 165 ++++++
.../es2015/uncategorised/291/options.json | 3 -
.../es2015/uncategorised/291/output.json | 111 ++++
.../es2015/uncategorised/296/options.json | 3 -
.../es2015/uncategorised/296/output.json | 146 +++++
.../es2015/uncategorised/297/options.json | 3 -
.../es2015/uncategorised/297/output.json | 179 ++++++
.../es2015/uncategorised/298/options.json | 3 -
.../es2015/uncategorised/298/output.json | 166 ++++++
.../es2015/uncategorised/324/options.json | 3 -
.../es2015/uncategorised/324/output.json | 106 ++++
.../es2015/uncategorised/325/options.json | 3 -
.../es2015/uncategorised/325/output.json | 106 ++++
.../es2015/uncategorised/329/options.json | 3 -
.../es2015/uncategorised/329/output.json | 126 ++++
.../es2015/uncategorised/332/options.json | 3 -
.../es2015/uncategorised/332/output.json | 171 ++++++
.../es2015/uncategorised/333/options.json | 3 -
.../es2015/uncategorised/333/output.json | 231 ++++++++
.../es2015/uncategorised/334/options.json | 5 +-
.../es2015/uncategorised/334/output.json | 135 +++++
.../es2015/uncategorised/339/options.json | 3 -
.../es2015/uncategorised/339/output.json | 91 +++
.../es2015/uncategorised/344/options.json | 3 -
.../es2015/uncategorised/344/output.json | 69 +++
.../es2015/uncategorised/347/options.json | 3 -
.../es2015/uncategorised/347/output.json | 179 ++++++
.../es2015/uncategorised/348/options.json | 3 -
.../es2015/uncategorised/348/output.json | 184 ++++++
.../es2015/uncategorised/349/options.json | 3 -
.../es2015/uncategorised/349/output.json | 187 ++++++
.../es2015/uncategorised/357/options.json | 5 +-
.../es2015/uncategorised/357/output.json | 119 ++++
.../es2015/uncategorised/359/options.json | 5 +-
.../es2015/uncategorised/359/output.json | 121 ++++
.../es2015/uncategorised/361/options.json | 5 +-
.../es2015/uncategorised/361/output.json | 176 ++++++
.../es2015/uncategorised/363/options.json | 5 +-
.../es2015/uncategorised/363/output.json | 163 +++++
.../es2015/uncategorised/365/options.json | 5 +-
.../es2015/uncategorised/365/output.json | 90 +++
.../es2015/uncategorised/367/options.json | 5 +-
.../es2015/uncategorised/367/output.json | 87 +++
.../es2015/uncategorised/368/options.json | 5 +-
.../es2015/uncategorised/368/output.json | 119 ++++
.../es2015/uncategorised/369/options.json | 5 +-
.../es2015/uncategorised/369/output.json | 119 ++++
.../es2015/uncategorised/37/options.json | 3 -
.../es2015/uncategorised/37/output.json | 160 +++++
.../es2015/uncategorised/370/options.json | 5 +-
.../es2015/uncategorised/370/output.json | 121 ++++
.../es2015/uncategorised/371/options.json | 5 +-
.../es2015/uncategorised/371/output.json | 121 ++++
.../es2015/uncategorised/372/options.json | 5 +-
.../es2015/uncategorised/372/output.json | 176 ++++++
.../es2015/uncategorised/373/options.json | 5 +-
.../es2015/uncategorised/373/output.json | 176 ++++++
.../es2015/uncategorised/374/options.json | 5 +-
.../es2015/uncategorised/374/output.json | 163 +++++
.../es2015/uncategorised/375/options.json | 5 +-
.../es2015/uncategorised/375/output.json | 163 +++++
.../es2015/uncategorised/376/options.json | 5 +-
.../es2015/uncategorised/376/output.json | 90 +++
.../es2015/uncategorised/377/options.json | 5 +-
.../es2015/uncategorised/377/output.json | 90 +++
.../es2015/uncategorised/378/options.json | 5 +-
.../es2015/uncategorised/378/output.json | 87 +++
.../es2015/uncategorised/379/options.json | 5 +-
.../es2015/uncategorised/379/output.json | 87 +++
.../es2015/uncategorised/395/options.json | 5 +-
.../es2015/uncategorised/395/output.json | 160 +++++
.../options.json | 3 -
.../output.json | 143 +++++
.../options.json | 3 -
.../output.json | 122 ++++
.../function-name-strict-body/options.json | 3 -
.../function-name-strict-body/output.json | 126 ++++
.../yield/function-name-strict/options.json | 3 -
.../yield/function-name-strict/output.json | 126 ++++
.../yield/in-class-heritage/options.json | 4 +-
.../yield/in-iterator-stmt/options.json | 4 +-
.../options.json | 3 -
.../output.json | 192 ++++++
.../options.json | 3 -
.../output.json | 331 +++++++++++
.../options.json | 3 -
.../output.json | 208 +++++++
.../options.json | 3 -
.../output.json | 261 ++++++++
.../options.json | 3 -
.../output.json | 230 ++++++++
.../options.json | 3 -
.../output.json | 196 ++++++
.../options.json | 3 -
.../output.json | 180 ++++++
.../options.json | 3 -
.../output.json | 140 +++++
.../parameter-default-strict/options.json | 3 -
.../parameter-default-strict/output.json | 176 ++++++
.../options.json | 3 -
.../output.json | 161 +++++
.../options.json | 3 -
.../output.json | 177 ++++++
.../options.json | 3 -
.../output.json | 195 ++++++
.../options.json | 3 -
.../output.json | 148 +++++
.../parameter-name-generator/options.json | 3 -
.../parameter-name-generator/output.json | 108 ++++
.../parameter-name-strict-body/options.json | 3 -
.../parameter-name-strict-body/output.json | 144 +++++
.../yield/parameter-name-strict/options.json | 3 -
.../yield/parameter-name-strict/output.json | 144 +++++
.../options.json | 3 -
.../output.json | 157 +++++
.../exponentiation-operator/10/options.json | 3 -
.../exponentiation-operator/10/output.json | 126 ++++
.../exponentiation-operator/11/options.json | 3 -
.../exponentiation-operator/11/output.json | 128 ++++
.../exponentiation-operator/12/options.json | 3 -
.../exponentiation-operator/12/output.json | 130 ++++
.../exponentiation-operator/15/options.json | 5 +-
.../exponentiation-operator/15/output.json | 141 +++++
.../exponentiation-operator/16/options.json | 5 +-
.../exponentiation-operator/16/output.json | 141 +++++
.../array-pattern-default/options.json | 3 -
.../array-pattern-default/output.json | 209 +++++++
.../array-pattern/options.json | 3 -
.../array-pattern/output.json | 178 ++++++
.../arrow-function/options.json | 3 -
.../arrow-function/output.json | 209 +++++++
.../async-arrow-function/options.json | 3 -
.../async-arrow-function/output.json | 209 +++++++
.../async-function/options.json | 3 -
.../async-function/output.json | 175 ++++++
.../default/options.json | 3 -
.../simple-parameter-list/default/output.json | 175 ++++++
.../generator-function/options.json | 3 -
.../generator-function/output.json | 175 ++++++
.../generator-method/options.json | 3 -
.../generator-method/output.json | 246 ++++++++
.../simple-parameter-list/method/options.json | 3 -
.../simple-parameter-list/method/output.json | 246 ++++++++
.../object-pattern-default/options.json | 3 -
.../object-pattern-default/output.json | 285 +++++++++
.../object-pattern/options.json | 3 -
.../object-pattern/output.json | 254 ++++++++
.../simple-parameter-list/rest/options.json | 3 -
.../simple-parameter-list/rest/output.json | 159 +++++
.../es2017/async-functions/2/options.json | 3 -
.../es2017/async-functions/2/output.json | 154 +++++
.../options.json | 3 -
.../output.json | 109 ++++
.../options.json | 3 -
.../output.json | 231 ++++++++
.../options.json | 3 -
.../output.json | 143 +++++
.../options.json | 3 -
.../output.json | 277 +++++++++
.../options.json | 3 -
.../output.json | 210 +++++++
.../options.json | 3 -
.../output.json | 210 +++++++
.../await-inside-parameters/options.json | 3 -
.../await-inside-parameters/output.json | 158 +++++
.../invalid-escape-await/options.json | 4 +-
.../invalid-inside-loop/options.json | 3 -
.../invalid-inside-loop/output.json | 125 ++++
.../no-constructor/options.json | 3 -
.../no-constructor/output.json | 144 +++++
.../options.json | 3 -
.../output.json | 122 ++++
.../es2018/object-rest-spread/11/options.json | 5 +-
.../es2018/object-rest-spread/11/output.json | 297 ++++++++++
.../es2018/object-rest-spread/12/options.json | 5 +-
.../es2018/object-rest-spread/12/output.json | 297 ++++++++++
.../es2018/object-rest-spread/13/options.json | 5 +-
.../es2018/object-rest-spread/13/output.json | 349 +++++++++++
.../es2018/object-rest-spread/14/options.json | 5 +-
.../es2018/object-rest-spread/14/output.json | 331 +++++++++++
.../es2018/object-rest-spread/15/options.json | 5 +-
.../es2018/object-rest-spread/15/output.json | 348 +++++++++++
.../es2018/object-rest-spread/18/options.json | 3 -
.../es2018/object-rest-spread/18/output.json | 137 +++++
.../es2018/object-rest-spread/21/options.json | 3 -
.../es2018/object-rest-spread/21/output.json | 173 ++++++
.../es2018/object-rest-spread/24/options.json | 3 -
.../es2018/object-rest-spread/24/output.json | 137 +++++
.../es2018/object-rest-spread/8/options.json | 3 -
.../es2018/object-rest-spread/8/output.json | 250 ++++++++
.../dupe-param/options.json | 3 -
.../dupe-param/output.json | 161 +++++
.../invalid-dup-param/options.json | 3 -
.../invalid-dup-param/output.json | 193 ++++++
.../dupe-param-1/options.json | 3 -
.../dupe-param-1/output.json | 178 ++++++
.../dupe-param-2/options.json | 3 -
.../dupe-param-2/output.json | 193 ++++++
.../dupe-param-3/options.json | 3 -
.../dupe-param-3/output.json | 248 ++++++++
.../options.json | 3 -
.../output.json | 159 +++++
.../invalid-duplicated-params/options.json | 3 -
.../invalid-duplicated-params/output.json | 124 ++++
.../invalid-param-strict-mode/options.json | 3 -
.../invalid-param-strict-mode/output.json | 143 +++++
.../options.json | 3 -
.../output.json | 198 +++++++
.../options.json | 3 -
.../output.json | 166 ++++++
.../options.json | 3 -
.../output.json | 538 +++++++++++++++++
.../invalid-lhs-01/options.json | 3 -
.../invalid-lhs-01/output.json | 160 +++++
.../invalid-lhs-02/options.json | 3 -
.../invalid-lhs-02/output.json | 160 +++++
.../invalid-pattern-with-method/input.js | 2 +-
.../invalid-pattern-with-method/options.json | 3 -
.../invalid-pattern-with-method/output.json | 166 ++++++
.../invalid-group-assignment/options.json | 3 -
.../invalid-group-assignment/output.json | 179 ++++++
.../invalid-export-named-default/options.json | 5 +-
.../invalid-export-named-default/output.json | 107 ++++
.../invalid-const-init/options.json | 3 -
.../invalid-const-init/output.json | 156 +++++
.../invalid-let-init/options.json | 3 -
.../invalid-let-init/output.json | 156 +++++
.../invalid-lhs-init/options.json | 3 -
.../invalid-lhs-init/output.json | 101 ++++
.../invalid-var-init/options.json | 3 -
.../invalid-var-init/output.json | 156 +++++
.../options.json | 3 -
.../output.json | 90 +++
.../invalid_expression_await/options.json | 3 -
.../invalid_expression_await/output.json | 158 +++++
.../invalid_var_await/options.json | 3 -
.../invalid_var_await/output.json | 106 ++++
.../options.json | 3 -
.../output.json | 88 +++
.../invalid_const_forin/options.json | 3 -
.../invalid_const_forin/output.json | 157 +++++
.../invalid_let_forin/options.json | 3 -
.../invalid_let_forin/output.json | 157 +++++
.../invalid-new-target/options.json | 3 -
.../invalid-new-target/output.json | 137 +++++
.../unknown-property/options.json | 3 -
.../unknown-property/output.json | 189 ++++++
.../options.json | 3 -
.../output.json | 234 ++++++++
.../options.json | 3 -
.../output.json | 177 ++++++
.../invalid-proto-identifiers/options.json | 3 -
.../invalid-proto-identifiers/output.json | 174 ++++++
.../options.json | 3 -
.../output.json | 177 ++++++
.../invalid-proto-literals/options.json | 3 -
.../invalid-proto-literals/output.json | 180 ++++++
.../options.json | 3 -
.../output.json | 252 ++++++++
.../options.json | 3 -
.../output.json | 119 ++++
.../invalid-escape/options.json | 3 -
.../invalid-escape/output.json | 91 +++
.../options.json | 3 -
.../output.json | 211 +++++++
.../options.json | 3 -
.../output.json | 164 ++++++
.../options.json | 3 -
.../output.json | 215 +++++++
.../options.json | 3 -
.../invalid-yield-generator-catch/output.json | 173 ++++++
.../options.json | 3 -
.../output.json | 143 +++++
.../options.json | 5 +-
.../output.json | 105 ++++
.../options.json | 3 -
.../output.json | 109 ++++
.../options.json | 3 -
.../output.json | 111 ++++
.../options.json | 3 -
.../output.json | 143 +++++
.../options.json | 3 -
.../output.json | 143 +++++
.../options.json | 3 -
.../output.json | 142 +++++
.../options.json | 3 -
.../output.json | 108 ++++
.../invalid-yield-generator-rest/options.json | 3 -
.../invalid-yield-generator-rest/output.json | 174 ++++++
.../options.json | 3 -
.../output.json | 229 ++++++++
.../options.json | 3 -
.../output.json | 231 ++++++++
.../options.json | 3 -
.../output.json | 142 +++++
.../options.json | 3 -
.../output.json | 160 +++++
.../options.json | 3 -
.../output.json | 175 ++++++
.../options.json | 3 -
.../output.json | 146 +++++
.../options.json | 3 -
.../output.json | 193 ++++++
.../options.json | 3 -
.../output.json | 156 +++++
.../options.json | 3 -
.../output.json | 144 +++++
.../options.json | 3 -
.../output.json | 126 ++++
.../options.json | 3 -
.../output.json | 145 +++++
.../options.json | 3 -
.../output.json | 159 +++++
.../options.json | 3 -
.../output.json | 144 +++++
.../options.json | 3 -
.../output.json | 159 +++++
.../options.json | 3 -
.../output.json | 125 ++++
.../options.json | 3 -
.../yield-generator-arrow-default/output.json | 192 ++++++
.../migrated_0012/input.js | 2 +-
.../migrated_0012/options.json | 3 -
.../migrated_0012/output.json | 70 +++
.../invalid-syntax/GH-1106-00/options.json | 3 -
.../invalid-syntax/GH-1106-00/output.json | 73 +++
.../invalid-syntax/GH-1106-01/options.json | 3 -
.../invalid-syntax/GH-1106-01/output.json | 73 +++
.../invalid-syntax/GH-1106-02/options.json | 3 -
.../invalid-syntax/GH-1106-02/output.json | 73 +++
.../invalid-syntax/GH-1106-03/options.json | 3 -
.../invalid-syntax/GH-1106-03/output.json | 73 +++
.../invalid-syntax/GH-1106-04/options.json | 3 -
.../invalid-syntax/GH-1106-04/output.json | 73 +++
.../invalid-syntax/GH-1106-05/options.json | 3 -
.../invalid-syntax/GH-1106-05/output.json | 73 +++
.../invalid-syntax/GH-1106-06/options.json | 3 -
.../invalid-syntax/GH-1106-06/output.json | 73 +++
.../invalid-syntax/GH-1106-07/options.json | 3 -
.../invalid-syntax/GH-1106-07/output.json | 73 +++
.../invalid-syntax/migrated_0002/options.json | 4 +-
.../invalid-syntax/migrated_0004/options.json | 3 -
.../invalid-syntax/migrated_0004/output.json | 73 +++
.../invalid-syntax/migrated_0005/options.json | 3 -
.../invalid-syntax/migrated_0005/output.json | 73 +++
.../invalid-syntax/migrated_0006/options.json | 3 -
.../invalid-syntax/migrated_0006/output.json | 73 +++
.../invalid-syntax/migrated_0009/options.json | 3 -
.../invalid-syntax/migrated_0009/output.json | 73 +++
.../invalid-syntax/migrated_0012/options.json | 3 -
.../invalid-syntax/migrated_0012/output.json | 73 +++
.../invalid-syntax/migrated_0013/options.json | 3 -
.../invalid-syntax/migrated_0013/output.json | 73 +++
.../invalid-syntax/migrated_0014/options.json | 3 -
.../invalid-syntax/migrated_0014/output.json | 73 +++
.../invalid-syntax/migrated_0015/options.json | 3 -
.../invalid-syntax/migrated_0015/output.json | 73 +++
.../invalid-syntax/migrated_0017/options.json | 3 -
.../invalid-syntax/migrated_0017/output.json | 73 +++
.../invalid-syntax/migrated_0019/options.json | 3 -
.../invalid-syntax/migrated_0019/output.json | 73 +++
.../invalid-syntax/migrated_0020/options.json | 3 -
.../invalid-syntax/migrated_0020/output.json | 73 +++
.../invalid-syntax/migrated_0021/options.json | 3 -
.../invalid-syntax/migrated_0021/output.json | 73 +++
.../invalid-syntax/migrated_0022/options.json | 3 -
.../invalid-syntax/migrated_0022/output.json | 73 +++
.../invalid-syntax/migrated_0024/options.json | 3 -
.../invalid-syntax/migrated_0024/output.json | 73 +++
.../invalid-syntax/migrated_0025/options.json | 3 -
.../invalid-syntax/migrated_0025/output.json | 73 +++
.../invalid-syntax/migrated_0026/options.json | 3 -
.../invalid-syntax/migrated_0026/output.json | 73 +++
.../invalid-syntax/migrated_0027/options.json | 3 -
.../invalid-syntax/migrated_0027/output.json | 73 +++
.../invalid-syntax/migrated_0028/options.json | 3 -
.../invalid-syntax/migrated_0028/output.json | 73 +++
.../invalid-syntax/migrated_0032/options.json | 3 -
.../invalid-syntax/migrated_0032/output.json | 70 +++
.../invalid-syntax/migrated_0033/input.js | 2 +-
.../invalid-syntax/migrated_0033/options.json | 3 -
.../invalid-syntax/migrated_0033/output.json | 70 +++
.../invalid-syntax/migrated_0034/input.js | 2 +-
.../invalid-syntax/migrated_0034/options.json | 3 -
.../invalid-syntax/migrated_0034/output.json | 70 +++
.../invalid-syntax/migrated_0036/input.js | 2 +-
.../invalid-syntax/migrated_0036/options.json | 3 -
.../invalid-syntax/migrated_0036/output.json | 70 +++
.../invalid-syntax/migrated_0037/input.js | 2 +-
.../invalid-syntax/migrated_0037/options.json | 3 -
.../invalid-syntax/migrated_0037/output.json | 70 +++
.../invalid-syntax/migrated_0041/input.js | 2 +-
.../invalid-syntax/migrated_0041/options.json | 3 -
.../invalid-syntax/migrated_0041/output.json | 109 ++++
.../invalid-syntax/migrated_0042/input.js | 2 +-
.../invalid-syntax/migrated_0042/options.json | 3 -
.../invalid-syntax/migrated_0042/output.json | 109 ++++
.../invalid-syntax/migrated_0043/input.js | 2 +-
.../invalid-syntax/migrated_0043/options.json | 3 -
.../invalid-syntax/migrated_0043/output.json | 110 ++++
.../invalid-syntax/migrated_0044/input.js | 2 +-
.../invalid-syntax/migrated_0044/options.json | 3 -
.../invalid-syntax/migrated_0044/output.json | 113 ++++
.../invalid-syntax/migrated_0045/options.json | 3 -
.../invalid-syntax/migrated_0045/output.json | 109 ++++
.../invalid-syntax/migrated_0046/options.json | 3 -
.../invalid-syntax/migrated_0046/output.json | 122 ++++
.../invalid-syntax/migrated_0047/options.json | 3 -
.../invalid-syntax/migrated_0047/output.json | 149 +++++
.../invalid-syntax/migrated_0048/input.js | 2 +-
.../invalid-syntax/migrated_0048/options.json | 4 +-
.../invalid-syntax/migrated_0049/input.js | 2 +-
.../invalid-syntax/migrated_0049/options.json | 3 -
.../invalid-syntax/migrated_0049/output.json | 70 +++
.../invalid-syntax/migrated_0050/input.js | 2 +-
.../invalid-syntax/migrated_0050/options.json | 3 -
.../invalid-syntax/migrated_0050/output.json | 70 +++
.../invalid-syntax/migrated_0051/input.js | 2 +-
.../invalid-syntax/migrated_0051/options.json | 3 -
.../invalid-syntax/migrated_0051/output.json | 70 +++
.../invalid-syntax/migrated_0052/options.json | 3 -
.../invalid-syntax/migrated_0052/output.json | 90 +++
.../invalid-syntax/migrated_0053/options.json | 3 -
.../invalid-syntax/migrated_0053/output.json | 90 +++
.../invalid-syntax/migrated_0054/options.json | 3 -
.../invalid-syntax/migrated_0054/output.json | 90 +++
.../invalid-syntax/migrated_0055/options.json | 3 -
.../invalid-syntax/migrated_0055/output.json | 90 +++
.../invalid-syntax/migrated_0056/options.json | 3 -
.../invalid-syntax/migrated_0056/output.json | 196 ++++++
.../invalid-syntax/migrated_0064/options.json | 3 -
.../invalid-syntax/migrated_0064/output.json | 108 ++++
.../invalid-syntax/migrated_0066/options.json | 3 -
.../invalid-syntax/migrated_0066/output.json | 142 +++++
.../invalid-syntax/migrated_0067/options.json | 3 -
.../invalid-syntax/migrated_0067/output.json | 123 ++++
.../invalid-syntax/migrated_0075/options.json | 6 +-
.../invalid-syntax/migrated_0075/output.json | 145 +++++
.../invalid-syntax/migrated_0087/options.json | 3 -
.../invalid-syntax/migrated_0087/output.json | 182 ++++++
.../invalid-syntax/migrated_0088/options.json | 3 -
.../invalid-syntax/migrated_0088/output.json | 146 +++++
.../invalid-syntax/migrated_0089/options.json | 3 -
.../invalid-syntax/migrated_0089/output.json | 146 +++++
.../invalid-syntax/migrated_0090/options.json | 3 -
.../invalid-syntax/migrated_0090/output.json | 163 +++++
.../invalid-syntax/migrated_0091/options.json | 3 -
.../invalid-syntax/migrated_0091/output.json | 163 +++++
.../invalid-syntax/migrated_0092/options.json | 3 -
.../invalid-syntax/migrated_0092/output.json | 127 ++++
.../invalid-syntax/migrated_0093/options.json | 3 -
.../invalid-syntax/migrated_0093/output.json | 163 +++++
.../invalid-syntax/migrated_0094/options.json | 3 -
.../invalid-syntax/migrated_0094/output.json | 146 +++++
.../invalid-syntax/migrated_0098/options.json | 3 -
.../invalid-syntax/migrated_0098/output.json | 113 ++++
.../invalid-syntax/migrated_0099/options.json | 3 -
.../invalid-syntax/migrated_0099/output.json | 134 +++++
.../invalid-syntax/migrated_0100/options.json | 3 -
.../invalid-syntax/migrated_0100/output.json | 146 +++++
.../invalid-syntax/migrated_0101/options.json | 3 -
.../invalid-syntax/migrated_0101/output.json | 179 ++++++
.../invalid-syntax/migrated_0116/options.json | 3 -
.../invalid-syntax/migrated_0116/output.json | 54 ++
.../invalid-syntax/migrated_0118/options.json | 3 -
.../invalid-syntax/migrated_0118/output.json | 54 ++
.../invalid-syntax/migrated_0125/options.json | 3 -
.../invalid-syntax/migrated_0125/output.json | 137 +++++
.../invalid-syntax/migrated_0126/options.json | 3 -
.../invalid-syntax/migrated_0126/output.json | 118 ++++
.../invalid-syntax/migrated_0133/options.json | 3 -
.../invalid-syntax/migrated_0133/output.json | 72 +++
.../invalid-syntax/migrated_0137/options.json | 3 -
.../invalid-syntax/migrated_0137/output.json | 106 ++++
.../invalid-syntax/migrated_0142/options.json | 3 -
.../invalid-syntax/migrated_0142/output.json | 140 +++++
.../invalid-syntax/migrated_0143/options.json | 3 -
.../invalid-syntax/migrated_0143/output.json | 106 ++++
.../invalid-syntax/migrated_0162/input.js | 2 +-
.../invalid-syntax/migrated_0162/options.json | 3 -
.../invalid-syntax/migrated_0162/output.json | 70 +++
.../invalid-syntax/migrated_0163/input.js | 2 +-
.../invalid-syntax/migrated_0163/options.json | 3 -
.../invalid-syntax/migrated_0163/output.json | 70 +++
.../invalid-syntax/migrated_0164/options.json | 3 -
.../invalid-syntax/migrated_0164/output.json | 70 +++
.../invalid-syntax/migrated_0165/input.js | 2 +-
.../invalid-syntax/migrated_0165/options.json | 3 -
.../invalid-syntax/migrated_0165/output.json | 70 +++
.../invalid-syntax/migrated_0166/options.json | 3 -
.../invalid-syntax/migrated_0166/output.json | 102 ++++
.../invalid-syntax/migrated_0167/options.json | 3 -
.../invalid-syntax/migrated_0167/output.json | 102 ++++
.../invalid-syntax/migrated_0169/input.js | 2 +-
.../invalid-syntax/migrated_0171/options.json | 3 -
.../invalid-syntax/migrated_0171/output.json | 54 ++
.../invalid-syntax/migrated_0172/options.json | 3 -
.../invalid-syntax/migrated_0172/output.json | 54 ++
.../invalid-syntax/migrated_0173/options.json | 3 -
.../invalid-syntax/migrated_0173/output.json | 54 ++
.../invalid-syntax/migrated_0174/options.json | 3 -
.../invalid-syntax/migrated_0174/output.json | 106 ++++
.../invalid-syntax/migrated_0176/options.json | 3 -
.../invalid-syntax/migrated_0176/output.json | 119 ++++
.../invalid-syntax/migrated_0177/options.json | 3 -
.../invalid-syntax/migrated_0177/output.json | 119 ++++
.../invalid-syntax/migrated_0178/options.json | 3 -
.../invalid-syntax/migrated_0178/output.json | 207 +++++++
.../invalid-syntax/migrated_0179/options.json | 3 -
.../invalid-syntax/migrated_0179/output.json | 207 +++++++
.../invalid-syntax/migrated_0180/options.json | 3 -
.../invalid-syntax/migrated_0180/output.json | 191 ++++++
.../invalid-syntax/migrated_0181/options.json | 3 -
.../invalid-syntax/migrated_0181/output.json | 191 ++++++
.../invalid-syntax/migrated_0182/options.json | 3 -
.../invalid-syntax/migrated_0182/output.json | 199 +++++++
.../invalid-syntax/migrated_0183/options.json | 3 -
.../invalid-syntax/migrated_0183/output.json | 195 ++++++
.../invalid-syntax/migrated_0184/options.json | 3 -
.../invalid-syntax/migrated_0184/output.json | 193 ++++++
.../invalid-syntax/migrated_0185/options.json | 3 -
.../invalid-syntax/migrated_0185/output.json | 197 +++++++
.../invalid-syntax/migrated_0186/options.json | 3 -
.../invalid-syntax/migrated_0186/output.json | 197 +++++++
.../invalid-syntax/migrated_0187/options.json | 3 -
.../invalid-syntax/migrated_0187/output.json | 209 +++++++
.../invalid-syntax/migrated_0188/options.json | 3 -
.../invalid-syntax/migrated_0188/output.json | 209 +++++++
.../invalid-syntax/migrated_0189/options.json | 3 -
.../invalid-syntax/migrated_0189/output.json | 195 ++++++
.../invalid-syntax/migrated_0190/options.json | 3 -
.../invalid-syntax/migrated_0190/output.json | 195 ++++++
.../invalid-syntax/migrated_0191/options.json | 3 -
.../invalid-syntax/migrated_0191/output.json | 176 ++++++
.../invalid-syntax/migrated_0192/options.json | 3 -
.../invalid-syntax/migrated_0192/output.json | 176 ++++++
.../invalid-syntax/migrated_0193/options.json | 3 -
.../invalid-syntax/migrated_0193/output.json | 176 ++++++
.../invalid-syntax/migrated_0194/options.json | 3 -
.../invalid-syntax/migrated_0194/output.json | 176 ++++++
.../invalid-syntax/migrated_0195/options.json | 3 -
.../invalid-syntax/migrated_0195/output.json | 176 ++++++
.../invalid-syntax/migrated_0196/options.json | 3 -
.../invalid-syntax/migrated_0196/output.json | 176 ++++++
.../invalid-syntax/migrated_0197/options.json | 3 -
.../invalid-syntax/migrated_0197/output.json | 176 ++++++
.../invalid-syntax/migrated_0198/options.json | 3 -
.../invalid-syntax/migrated_0198/output.json | 176 ++++++
.../invalid-syntax/migrated_0199/options.json | 3 -
.../invalid-syntax/migrated_0199/output.json | 179 ++++++
.../invalid-syntax/migrated_0200/options.json | 3 -
.../invalid-syntax/migrated_0200/output.json | 179 ++++++
.../invalid-syntax/migrated_0201/options.json | 3 -
.../invalid-syntax/migrated_0201/output.json | 126 ++++
.../invalid-syntax/migrated_0202/options.json | 3 -
.../invalid-syntax/migrated_0202/output.json | 126 ++++
.../invalid-syntax/migrated_0203/options.json | 3 -
.../invalid-syntax/migrated_0203/output.json | 214 +++++++
.../invalid-syntax/migrated_0204/options.json | 3 -
.../invalid-syntax/migrated_0204/output.json | 214 +++++++
.../invalid-syntax/migrated_0205/options.json | 3 -
.../invalid-syntax/migrated_0205/output.json | 161 +++++
.../invalid-syntax/migrated_0206/options.json | 3 -
.../invalid-syntax/migrated_0206/output.json | 161 +++++
.../invalid-syntax/migrated_0207/options.json | 3 -
.../invalid-syntax/migrated_0207/output.json | 250 ++++++++
.../invalid-syntax/migrated_0208/options.json | 3 -
.../invalid-syntax/migrated_0208/output.json | 161 +++++
.../invalid-syntax/migrated_0209/options.json | 3 -
.../invalid-syntax/migrated_0209/output.json | 292 +++++++++
.../invalid-syntax/migrated_0210/options.json | 3 -
.../invalid-syntax/migrated_0210/output.json | 237 ++++++++
.../invalid-syntax/migrated_0211/options.json | 3 -
.../invalid-syntax/migrated_0211/output.json | 268 +++++++++
.../invalid-syntax/migrated_0212/options.json | 3 -
.../invalid-syntax/migrated_0212/output.json | 144 +++++
.../invalid-syntax/migrated_0213/options.json | 3 -
.../invalid-syntax/migrated_0213/output.json | 144 +++++
.../invalid-syntax/migrated_0214/options.json | 3 -
.../invalid-syntax/migrated_0214/output.json | 197 +++++++
.../invalid-syntax/migrated_0215/options.json | 3 -
.../invalid-syntax/migrated_0215/output.json | 197 +++++++
.../invalid-syntax/migrated_0216/options.json | 3 -
.../invalid-syntax/migrated_0216/output.json | 108 ++++
.../invalid-syntax/migrated_0217/options.json | 3 -
.../invalid-syntax/migrated_0217/output.json | 162 +++++
.../invalid-syntax/migrated_0218/options.json | 3 -
.../invalid-syntax/migrated_0218/output.json | 163 +++++
.../invalid-syntax/migrated_0219/options.json | 3 -
.../invalid-syntax/migrated_0219/output.json | 221 +++++++
.../invalid-syntax/migrated_0220/options.json | 3 -
.../invalid-syntax/migrated_0220/output.json | 221 +++++++
.../invalid-syntax/migrated_0221/options.json | 3 -
.../invalid-syntax/migrated_0221/output.json | 161 +++++
.../invalid-syntax/migrated_0222/options.json | 3 -
.../invalid-syntax/migrated_0222/output.json | 197 +++++++
.../invalid-syntax/migrated_0223/options.json | 3 -
.../invalid-syntax/migrated_0223/output.json | 215 +++++++
.../invalid-syntax/migrated_0224/options.json | 3 -
.../invalid-syntax/migrated_0224/output.json | 178 ++++++
.../invalid-syntax/migrated_0225/options.json | 3 -
.../invalid-syntax/migrated_0225/output.json | 178 ++++++
.../invalid-syntax/migrated_0226/options.json | 3 -
.../invalid-syntax/migrated_0226/output.json | 178 ++++++
.../invalid-syntax/migrated_0227/options.json | 3 -
.../invalid-syntax/migrated_0227/output.json | 178 ++++++
.../invalid-syntax/migrated_0228/options.json | 3 -
.../invalid-syntax/migrated_0228/output.json | 178 ++++++
.../invalid-syntax/migrated_0229/options.json | 3 -
.../invalid-syntax/migrated_0229/output.json | 178 ++++++
.../invalid-syntax/migrated_0230/options.json | 3 -
.../invalid-syntax/migrated_0230/output.json | 178 ++++++
.../invalid-syntax/migrated_0231/options.json | 3 -
.../invalid-syntax/migrated_0231/output.json | 178 ++++++
.../invalid-syntax/migrated_0232/options.json | 3 -
.../invalid-syntax/migrated_0232/output.json | 178 ++++++
.../invalid-syntax/migrated_0233/options.json | 3 -
.../invalid-syntax/migrated_0233/output.json | 144 +++++
.../invalid-syntax/migrated_0234/options.json | 3 -
.../invalid-syntax/migrated_0234/output.json | 126 ++++
.../invalid-syntax/migrated_0235/options.json | 3 -
.../invalid-syntax/migrated_0235/output.json | 144 +++++
.../invalid-syntax/migrated_0236/options.json | 3 -
.../invalid-syntax/migrated_0236/output.json | 144 +++++
.../invalid-syntax/migrated_0239/options.json | 3 -
.../invalid-syntax/migrated_0239/output.json | 126 ++++
.../invalid-syntax/migrated_0240/options.json | 3 -
.../invalid-syntax/migrated_0240/output.json | 161 +++++
.../invalid-syntax/migrated_0241/options.json | 3 -
.../invalid-syntax/migrated_0241/output.json | 144 +++++
.../invalid-syntax/migrated_0242/options.json | 3 -
.../invalid-syntax/migrated_0242/output.json | 144 +++++
.../invalid-syntax/migrated_0243/options.json | 3 -
.../invalid-syntax/migrated_0243/output.json | 229 ++++++++
.../invalid-syntax/migrated_0244/options.json | 3 -
.../invalid-syntax/migrated_0244/output.json | 180 ++++++
.../invalid-syntax/migrated_0245/options.json | 3 -
.../invalid-syntax/migrated_0245/output.json | 233 ++++++++
.../invalid-syntax/migrated_0246/options.json | 3 -
.../invalid-syntax/migrated_0246/output.json | 163 +++++
.../invalid-syntax/migrated_0247/options.json | 3 -
.../invalid-syntax/migrated_0247/output.json | 163 +++++
.../invalid-syntax/migrated_0248/options.json | 3 -
.../invalid-syntax/migrated_0248/output.json | 137 +++++
.../invalid-syntax/migrated_0249/options.json | 3 -
.../invalid-syntax/migrated_0249/output.json | 161 +++++
.../invalid-syntax/migrated_0250/options.json | 3 -
.../invalid-syntax/migrated_0250/output.json | 213 +++++++
.../invalid-syntax/migrated_0270/options.json | 3 -
.../invalid-syntax/migrated_0270/output.json | 144 +++++
.../invalid-syntax/migrated_0271/options.json | 3 -
.../invalid-syntax/migrated_0271/output.json | 147 +++++
.../invalid-syntax/migrated_0272/options.json | 3 -
.../invalid-syntax/migrated_0272/output.json | 144 +++++
.../invalid-syntax/migrated_0273/options.json | 3 -
.../invalid-syntax/migrated_0273/output.json | 162 +++++
.../invalid-syntax/migrated_0274/options.json | 3 -
.../invalid-syntax/migrated_0274/output.json | 203 +++++++
.../invalid-syntax/migrated_0277/options.json | 3 -
.../invalid-syntax/migrated_0277/output.json | 162 +++++
.../invalid-syntax/migrated_0278/options.json | 3 -
.../invalid-syntax/migrated_0278/output.json | 144 +++++
.../invalid-setter-rest/options.json | 3 -
.../invalid-setter-rest/output.json | 192 ++++++
.../migrated_0002/options.json | 3 -
.../migrated_0002/output.json | 70 +++
.../migrated_0003/options.json | 3 -
.../migrated_0003/output.json | 70 +++
.../migrated_0004/options.json | 3 -
.../migrated_0004/output.json | 70 +++
.../migrated_0005/options.json | 3 -
.../migrated_0005/output.json | 70 +++
.../options.json | 3 -
.../complex-pattern-requires-init/output.json | 88 +++
.../bigint/invalid-decimal/options.json | 1 -
.../bigint/invalid-decimal/output.json | 73 +++
.../bigint/invalid-e/options.json | 1 -
.../experimental/bigint/invalid-e/output.json | 73 +++
.../options.json | 6 +-
.../invalid-non-octal-decimal-int/output.json | 73 +++
.../bigint/invalid-octal-legacy/options.json | 1 -
.../bigint/invalid-octal-legacy/output.json | 73 +++
.../failure-name-constructor/options.json | 7 +-
.../failure-name-constructor/output.json | 158 +++++
.../failure-spaces/options.json | 1 -
.../failure-spaces/output.json | 207 +++++++
.../options.json | 7 +-
.../output.json | 289 +++++++++
.../failure-name-constructor/options.json | 7 +-
.../failure-name-constructor/output.json | 137 +++++
.../failure-spaces/options.json | 3 +-
.../failure-spaces/output.json | 137 +++++
.../super-call/options.json | 7 +-
.../super-call/output.json | 306 ++++++++++
.../super-private-member-access/options.json | 5 +-
.../super-private-member-access/output.json | 288 +++++++++
.../arguments-in-arrow-function/options.json | 7 +-
.../arguments-in-arrow-function/output.json | 211 +++++++
.../class-properties/arguments/options.json | 7 +-
.../class-properties/arguments/output.json | 192 ++++++
.../new-target-invalid/options.json | 7 +-
.../new-target-invalid/output.json | 137 +++++
.../class-properties/no-ctor-2/options.json | 5 +-
.../class-properties/no-ctor-2/output.json | 179 ++++++
.../class-properties/no-ctor/options.json | 5 +-
.../class-properties/no-ctor/output.json | 123 ++++
.../no-static-prototype-2/options.json | 7 +-
.../no-static-prototype-2/output.json | 179 ++++++
.../no-static-prototype/options.json | 7 +-
.../no-static-prototype/output.json | 123 ++++
.../options.json | 7 +-
.../output.json | 123 ++++
.../class-properties/super-call/options.json | 7 +-
.../class-properties/super-call/output.json | 292 +++++++++
.../super-inside-function/options.json | 7 +-
.../super-inside-function/output.json | 254 ++++++++
.../options.json | 14 +-
.../output.json | 136 +++++
.../no-class-method-parameter/options.json | 3 -
.../no-class-method-parameter/output.json | 196 ++++++
.../no-constructor-decorators/options.json | 3 -
.../no-constructor-decorators/output.json | 178 ++++++
.../options.json | 3 +-
.../no-export-decorators-on-class/output.json | 120 ++++
.../no-function-parameters/options.json | 3 -
.../no-function-parameters/output.json | 142 +++++
.../no-object-method-parameters/options.json | 3 -
.../no-object-method-parameters/output.json | 213 +++++++
.../no-object-methods/options.json | 11 +-
.../no-object-methods/output.json | 195 ++++++
.../no-constructor-decorators/options.json | 3 -
.../no-constructor-decorators/output.json | 178 ++++++
.../direct-calls-only/options.json | 6 +-
.../direct-calls-only/output.json | 172 ++++++
.../invalid-arguments-spread/options.json | 6 +-
.../invalid-arguments-spread/output.json | 137 +++++
.../dynamic-import/invalid-new/options.json | 6 +-
.../dynamic-import/invalid-new/output.json | 105 ++++
.../invalid-trailing-comma/options.json | 4 +-
.../invalid-trailing-comma/output.json | 108 ++++
.../dynamic-import/multiple-args/options.json | 6 +-
.../dynamic-import/multiple-args/output.json | 125 ++++
.../dynamic-import/no-args/options.json | 6 +-
.../dynamic-import/no-args/output.json | 84 +++
.../import-meta/error-in-script/options.json | 8 +-
.../import-meta/error-in-script/output.json | 137 +++++
.../no-other-prop-names/options.json | 8 +-
.../no-other-prop-names/output.json | 102 ++++
.../import-meta/not-assignable/options.json | 8 +-
.../import-meta/not-assignable/output.json | 134 +++++
.../numeric-separator/invalid-0/options.json | 1 -
.../numeric-separator/invalid-0/output.json | 73 +++
.../numeric-separator/invalid-1/options.json | 1 -
.../numeric-separator/invalid-1/output.json | 73 +++
.../numeric-separator/invalid-10/options.json | 1 -
.../numeric-separator/invalid-10/output.json | 73 +++
.../invalid-100/options.json | 1 -
.../numeric-separator/invalid-100/output.json | 75 +++
.../invalid-101/options.json | 1 -
.../numeric-separator/invalid-101/output.json | 75 +++
.../invalid-102/options.json | 1 -
.../numeric-separator/invalid-102/output.json | 76 +++
.../invalid-103/options.json | 1 -
.../numeric-separator/invalid-103/output.json | 76 +++
.../invalid-104/options.json | 1 -
.../numeric-separator/invalid-104/output.json | 75 +++
.../invalid-105/options.json | 1 -
.../numeric-separator/invalid-105/output.json | 75 +++
.../invalid-106/options.json | 1 -
.../numeric-separator/invalid-106/output.json | 75 +++
.../invalid-107/options.json | 1 -
.../numeric-separator/invalid-107/output.json | 75 +++
.../invalid-108/options.json | 1 -
.../numeric-separator/invalid-108/output.json | 75 +++
.../invalid-109/options.json | 1 -
.../numeric-separator/invalid-109/output.json | 75 +++
.../numeric-separator/invalid-11/options.json | 1 -
.../numeric-separator/invalid-11/output.json | 73 +++
.../invalid-110/options.json | 1 -
.../numeric-separator/invalid-110/output.json | 75 +++
.../invalid-111/options.json | 1 -
.../numeric-separator/invalid-111/output.json | 75 +++
.../invalid-112/options.json | 1 -
.../numeric-separator/invalid-112/output.json | 75 +++
.../invalid-113/options.json | 1 -
.../numeric-separator/invalid-113/output.json | 77 +++
.../invalid-114/options.json | 1 -
.../numeric-separator/invalid-114/output.json | 77 +++
.../invalid-115/options.json | 1 -
.../numeric-separator/invalid-115/output.json | 76 +++
.../invalid-116/options.json | 1 -
.../numeric-separator/invalid-116/output.json | 75 +++
.../invalid-117/options.json | 1 -
.../numeric-separator/invalid-117/output.json | 75 +++
.../invalid-118/options.json | 1 -
.../numeric-separator/invalid-118/output.json | 76 +++
.../invalid-119/options.json | 1 -
.../numeric-separator/invalid-119/output.json | 75 +++
.../numeric-separator/invalid-12/options.json | 1 -
.../numeric-separator/invalid-12/output.json | 73 +++
.../invalid-120/options.json | 1 -
.../numeric-separator/invalid-120/output.json | 76 +++
.../invalid-121/options.json | 1 -
.../numeric-separator/invalid-121/output.json | 75 +++
.../invalid-122/options.json | 1 -
.../numeric-separator/invalid-122/output.json | 75 +++
.../invalid-123/options.json | 1 -
.../numeric-separator/invalid-123/output.json | 76 +++
.../invalid-124/options.json | 1 -
.../numeric-separator/invalid-124/output.json | 91 +++
.../invalid-125/options.json | 1 -
.../numeric-separator/invalid-125/output.json | 91 +++
.../invalid-126/options.json | 1 -
.../numeric-separator/invalid-126/output.json | 92 +++
.../invalid-127/options.json | 1 -
.../numeric-separator/invalid-127/output.json | 92 +++
.../invalid-128/options.json | 1 -
.../numeric-separator/invalid-128/output.json | 91 +++
.../invalid-129/options.json | 1 -
.../numeric-separator/invalid-129/output.json | 91 +++
.../numeric-separator/invalid-13/options.json | 1 -
.../numeric-separator/invalid-13/output.json | 75 +++
.../invalid-130/options.json | 1 -
.../numeric-separator/invalid-130/output.json | 91 +++
.../invalid-131/options.json | 1 -
.../numeric-separator/invalid-131/output.json | 91 +++
.../invalid-132/options.json | 1 -
.../numeric-separator/invalid-132/output.json | 91 +++
.../invalid-133/options.json | 1 -
.../numeric-separator/invalid-133/output.json | 91 +++
.../invalid-134/options.json | 1 -
.../numeric-separator/invalid-134/output.json | 91 +++
.../invalid-135/options.json | 1 -
.../numeric-separator/invalid-135/output.json | 91 +++
.../invalid-136/options.json | 1 -
.../numeric-separator/invalid-136/output.json | 91 +++
.../invalid-137/options.json | 1 -
.../numeric-separator/invalid-137/output.json | 93 +++
.../invalid-138/options.json | 1 -
.../numeric-separator/invalid-138/output.json | 93 +++
.../invalid-139/options.json | 1 -
.../numeric-separator/invalid-139/output.json | 92 +++
.../numeric-separator/invalid-14/options.json | 1 -
.../numeric-separator/invalid-14/output.json | 75 +++
.../invalid-140/options.json | 1 -
.../numeric-separator/invalid-140/output.json | 91 +++
.../invalid-141/options.json | 1 -
.../numeric-separator/invalid-141/output.json | 91 +++
.../invalid-142/options.json | 1 -
.../numeric-separator/invalid-142/output.json | 92 +++
.../invalid-143/options.json | 1 -
.../numeric-separator/invalid-143/output.json | 91 +++
.../invalid-144/options.json | 1 -
.../numeric-separator/invalid-144/output.json | 92 +++
.../invalid-145/options.json | 1 -
.../numeric-separator/invalid-145/output.json | 91 +++
.../invalid-146/options.json | 1 -
.../numeric-separator/invalid-146/output.json | 91 +++
.../invalid-147/options.json | 1 -
.../numeric-separator/invalid-147/output.json | 92 +++
.../numeric-separator/invalid-15/options.json | 1 -
.../numeric-separator/invalid-15/output.json | 74 +++
.../numeric-separator/invalid-16/options.json | 1 -
.../numeric-separator/invalid-16/output.json | 73 +++
.../numeric-separator/invalid-17/options.json | 1 -
.../numeric-separator/invalid-17/output.json | 73 +++
.../numeric-separator/invalid-18/options.json | 1 -
.../numeric-separator/invalid-18/output.json | 74 +++
.../numeric-separator/invalid-19/options.json | 1 -
.../numeric-separator/invalid-19/output.json | 73 +++
.../numeric-separator/invalid-2/options.json | 1 -
.../numeric-separator/invalid-2/output.json | 74 +++
.../numeric-separator/invalid-20/options.json | 1 -
.../numeric-separator/invalid-20/output.json | 74 +++
.../numeric-separator/invalid-21/options.json | 1 -
.../numeric-separator/invalid-21/output.json | 73 +++
.../numeric-separator/invalid-22/options.json | 1 -
.../numeric-separator/invalid-22/output.json | 73 +++
.../numeric-separator/invalid-23/options.json | 1 -
.../numeric-separator/invalid-23/output.json | 74 +++
.../numeric-separator/invalid-25/options.json | 1 -
.../numeric-separator/invalid-25/output.json | 74 +++
.../numeric-separator/invalid-26/options.json | 1 -
.../numeric-separator/invalid-26/output.json | 73 +++
.../numeric-separator/invalid-27/options.json | 4 +-
.../numeric-separator/invalid-28/options.json | 1 -
.../numeric-separator/invalid-28/output.json | 73 +++
.../numeric-separator/invalid-29/options.json | 1 -
.../numeric-separator/invalid-29/output.json | 73 +++
.../numeric-separator/invalid-3/options.json | 1 -
.../numeric-separator/invalid-3/output.json | 74 +++
.../numeric-separator/invalid-30/options.json | 1 -
.../numeric-separator/invalid-30/output.json | 74 +++
.../numeric-separator/invalid-31/options.json | 1 -
.../numeric-separator/invalid-31/output.json | 74 +++
.../numeric-separator/invalid-32/options.json | 1 -
.../numeric-separator/invalid-32/output.json | 73 +++
.../numeric-separator/invalid-33/options.json | 1 -
.../numeric-separator/invalid-33/output.json | 73 +++
.../numeric-separator/invalid-34/options.json | 1 -
.../numeric-separator/invalid-34/output.json | 73 +++
.../numeric-separator/invalid-35/options.json | 1 -
.../numeric-separator/invalid-35/output.json | 73 +++
.../numeric-separator/invalid-36/options.json | 1 -
.../numeric-separator/invalid-36/output.json | 73 +++
.../numeric-separator/invalid-37/options.json | 1 -
.../numeric-separator/invalid-37/output.json | 73 +++
.../numeric-separator/invalid-38/options.json | 1 -
.../numeric-separator/invalid-38/output.json | 73 +++
.../numeric-separator/invalid-39/options.json | 1 -
.../numeric-separator/invalid-39/output.json | 73 +++
.../numeric-separator/invalid-4/options.json | 1 -
.../numeric-separator/invalid-4/output.json | 73 +++
.../numeric-separator/invalid-40/options.json | 1 -
.../numeric-separator/invalid-40/output.json | 73 +++
.../numeric-separator/invalid-41/options.json | 1 -
.../numeric-separator/invalid-41/output.json | 75 +++
.../numeric-separator/invalid-42/options.json | 1 -
.../numeric-separator/invalid-42/output.json | 75 +++
.../numeric-separator/invalid-43/options.json | 1 -
.../numeric-separator/invalid-43/output.json | 74 +++
.../numeric-separator/invalid-44/options.json | 1 -
.../numeric-separator/invalid-44/output.json | 73 +++
.../numeric-separator/invalid-45/options.json | 1 -
.../numeric-separator/invalid-45/output.json | 73 +++
.../numeric-separator/invalid-46/options.json | 1 -
.../numeric-separator/invalid-46/output.json | 74 +++
.../numeric-separator/invalid-47/options.json | 1 -
.../numeric-separator/invalid-47/output.json | 73 +++
.../numeric-separator/invalid-48/options.json | 1 -
.../numeric-separator/invalid-48/output.json | 74 +++
.../numeric-separator/invalid-49/options.json | 1 -
.../numeric-separator/invalid-49/output.json | 73 +++
.../numeric-separator/invalid-5/options.json | 1 -
.../numeric-separator/invalid-5/output.json | 73 +++
.../numeric-separator/invalid-50/options.json | 1 -
.../numeric-separator/invalid-50/output.json | 73 +++
.../numeric-separator/invalid-51/options.json | 1 -
.../numeric-separator/invalid-51/output.json | 74 +++
.../numeric-separator/invalid-52/input.js | 2 +-
.../numeric-separator/invalid-52/options.json | 1 -
.../numeric-separator/invalid-52/output.json | 110 ++++
.../numeric-separator/invalid-53/input.js | 2 +-
.../numeric-separator/invalid-53/options.json | 1 -
.../numeric-separator/invalid-53/output.json | 110 ++++
.../numeric-separator/invalid-54/input.js | 2 +-
.../numeric-separator/invalid-54/options.json | 1 -
.../numeric-separator/invalid-54/output.json | 111 ++++
.../numeric-separator/invalid-55/input.js | 2 +-
.../numeric-separator/invalid-55/options.json | 1 -
.../numeric-separator/invalid-55/output.json | 111 ++++
.../numeric-separator/invalid-56/input.js | 2 +-
.../numeric-separator/invalid-56/options.json | 1 -
.../numeric-separator/invalid-56/output.json | 110 ++++
.../numeric-separator/invalid-57/input.js | 2 +-
.../numeric-separator/invalid-57/options.json | 1 -
.../numeric-separator/invalid-57/output.json | 110 ++++
.../numeric-separator/invalid-58/input.js | 2 +-
.../numeric-separator/invalid-58/options.json | 1 -
.../numeric-separator/invalid-58/output.json | 110 ++++
.../numeric-separator/invalid-59/input.js | 2 +-
.../numeric-separator/invalid-59/options.json | 1 -
.../numeric-separator/invalid-59/output.json | 110 ++++
.../numeric-separator/invalid-6/options.json | 1 -
.../numeric-separator/invalid-6/output.json | 73 +++
.../numeric-separator/invalid-60/input.js | 2 +-
.../numeric-separator/invalid-60/options.json | 1 -
.../numeric-separator/invalid-60/output.json | 110 ++++
.../numeric-separator/invalid-61/input.js | 2 +-
.../numeric-separator/invalid-61/options.json | 1 -
.../numeric-separator/invalid-61/output.json | 110 ++++
.../numeric-separator/invalid-62/input.js | 2 +-
.../numeric-separator/invalid-62/options.json | 1 -
.../numeric-separator/invalid-62/output.json | 110 ++++
.../numeric-separator/invalid-63/input.js | 2 +-
.../numeric-separator/invalid-63/options.json | 1 -
.../numeric-separator/invalid-63/output.json | 110 ++++
.../numeric-separator/invalid-64/input.js | 2 +-
.../numeric-separator/invalid-64/options.json | 1 -
.../numeric-separator/invalid-64/output.json | 110 ++++
.../numeric-separator/invalid-65/input.js | 2 +-
.../numeric-separator/invalid-65/options.json | 1 -
.../numeric-separator/invalid-65/output.json | 112 ++++
.../numeric-separator/invalid-66/input.js | 2 +-
.../numeric-separator/invalid-66/options.json | 1 -
.../numeric-separator/invalid-66/output.json | 112 ++++
.../numeric-separator/invalid-67/input.js | 2 +-
.../numeric-separator/invalid-67/options.json | 1 -
.../numeric-separator/invalid-67/output.json | 111 ++++
.../numeric-separator/invalid-68/input.js | 2 +-
.../numeric-separator/invalid-68/options.json | 1 -
.../numeric-separator/invalid-68/output.json | 110 ++++
.../numeric-separator/invalid-69/input.js | 2 +-
.../numeric-separator/invalid-69/options.json | 1 -
.../numeric-separator/invalid-69/output.json | 110 ++++
.../numeric-separator/invalid-7/options.json | 1 -
.../numeric-separator/invalid-7/output.json | 73 +++
.../numeric-separator/invalid-70/input.js | 2 +-
.../numeric-separator/invalid-70/options.json | 1 -
.../numeric-separator/invalid-70/output.json | 111 ++++
.../numeric-separator/invalid-71/input.js | 2 +-
.../numeric-separator/invalid-71/options.json | 1 -
.../numeric-separator/invalid-71/output.json | 110 ++++
.../numeric-separator/invalid-72/input.js | 2 +-
.../numeric-separator/invalid-72/options.json | 1 -
.../numeric-separator/invalid-72/output.json | 111 ++++
.../numeric-separator/invalid-73/input.js | 2 +-
.../numeric-separator/invalid-73/options.json | 1 -
.../numeric-separator/invalid-73/output.json | 110 ++++
.../numeric-separator/invalid-74/input.js | 2 +-
.../numeric-separator/invalid-74/options.json | 1 -
.../numeric-separator/invalid-74/output.json | 110 ++++
.../numeric-separator/invalid-75/input.js | 2 +-
.../numeric-separator/invalid-75/options.json | 1 -
.../numeric-separator/invalid-75/output.json | 111 ++++
.../numeric-separator/invalid-76/options.json | 1 -
.../numeric-separator/invalid-76/output.json | 90 +++
.../numeric-separator/invalid-77/options.json | 1 -
.../numeric-separator/invalid-77/output.json | 90 +++
.../numeric-separator/invalid-78/options.json | 1 -
.../numeric-separator/invalid-78/output.json | 91 +++
.../numeric-separator/invalid-79/options.json | 1 -
.../numeric-separator/invalid-79/output.json | 91 +++
.../numeric-separator/invalid-8/options.json | 1 -
.../numeric-separator/invalid-8/output.json | 73 +++
.../numeric-separator/invalid-80/options.json | 1 -
.../numeric-separator/invalid-80/output.json | 90 +++
.../numeric-separator/invalid-81/options.json | 1 -
.../numeric-separator/invalid-81/output.json | 90 +++
.../numeric-separator/invalid-82/options.json | 1 -
.../numeric-separator/invalid-82/output.json | 90 +++
.../numeric-separator/invalid-83/options.json | 1 -
.../numeric-separator/invalid-83/output.json | 90 +++
.../numeric-separator/invalid-84/options.json | 1 -
.../numeric-separator/invalid-84/output.json | 90 +++
.../numeric-separator/invalid-85/options.json | 1 -
.../numeric-separator/invalid-85/output.json | 90 +++
.../numeric-separator/invalid-86/options.json | 1 -
.../numeric-separator/invalid-86/output.json | 90 +++
.../numeric-separator/invalid-87/options.json | 1 -
.../numeric-separator/invalid-87/output.json | 90 +++
.../numeric-separator/invalid-88/options.json | 1 -
.../numeric-separator/invalid-88/output.json | 90 +++
.../numeric-separator/invalid-89/options.json | 1 -
.../numeric-separator/invalid-89/output.json | 92 +++
.../numeric-separator/invalid-9/options.json | 1 -
.../numeric-separator/invalid-9/output.json | 73 +++
.../numeric-separator/invalid-90/options.json | 1 -
.../numeric-separator/invalid-90/output.json | 92 +++
.../numeric-separator/invalid-91/options.json | 1 -
.../numeric-separator/invalid-91/output.json | 91 +++
.../numeric-separator/invalid-92/options.json | 1 -
.../numeric-separator/invalid-92/output.json | 90 +++
.../numeric-separator/invalid-93/options.json | 1 -
.../numeric-separator/invalid-93/output.json | 90 +++
.../numeric-separator/invalid-94/options.json | 1 -
.../numeric-separator/invalid-94/output.json | 91 +++
.../numeric-separator/invalid-95/options.json | 1 -
.../numeric-separator/invalid-95/output.json | 90 +++
.../numeric-separator/invalid-96/options.json | 1 -
.../numeric-separator/invalid-96/output.json | 91 +++
.../numeric-separator/invalid-97/options.json | 1 -
.../numeric-separator/invalid-97/output.json | 90 +++
.../numeric-separator/invalid-98/options.json | 1 -
.../numeric-separator/invalid-98/output.json | 90 +++
.../numeric-separator/invalid-99/options.json | 1 -
.../numeric-separator/invalid-99/output.json | 91 +++
.../invalid-hex/options.json | 7 +-
.../numeric-separator/invalid-hex/output.json | 73 +++
.../invalid-leading-zero/options.json | 7 +-
.../invalid-leading-zero/output.json | 73 +++
.../invalid-legacy-octal-literal/options.json | 7 +-
.../invalid-legacy-octal-literal/output.json | 73 +++
.../options.json | 7 +-
.../invalid-non-octal-decimal-int/output.json | 74 +++
.../invalid-unicode-2/options.json | 7 +-
.../invalid-unicode-2/output.json | 73 +++
.../invalid-unicode/options.json | 7 +-
.../invalid-unicode/output.json | 73 +++
.../class-contructor-call/options.json | 7 +-
.../class-contructor-call/output.json | 154 +++++
.../optional-constructor/options.json | 7 +-
.../optional-constructor/output.json | 86 +++
.../options.json | 3 +-
.../optional-super-property-class/output.json | 209 +++++++
.../optional-super-property/options.json | 3 +-
.../optional-super-property/output.json | 226 +++++++
.../options.json | 7 +-
.../output.json | 157 +++++
.../in-SuperCall/options.json | 7 +-
.../in-SuperCall/output.json | 390 ++++++++++++
.../partial-application/in-new/options.json | 7 +-
.../partial-application/in-new/output.json | 155 +++++
.../options.json | 12 +-
.../output.json | 162 +++++
.../options.json | 3 +-
.../output.json | 207 +++++++
.../options.json | 3 +-
.../output.json | 241 ++++++++
.../options.json | 3 +-
.../output.json | 205 +++++++
.../options.json | 3 +-
.../output.json | 184 ++++++
.../options.json | 3 +-
.../output.json | 170 ++++++
.../options.json | 12 +-
.../output.json | 203 +++++++
.../options.json | 12 +-
.../output.json | 155 +++++
.../options.json | 3 +-
.../output.json | 151 +++++
.../options.json | 3 +-
.../output.json | 151 +++++
.../options.json | 3 +-
.../output.json | 134 +++++
.../options.json | 3 +-
.../output.json | 172 ++++++
.../input.js | 2 +-
.../options.json | 3 +-
.../output.json | 266 +++++++++
.../options.json | 3 +-
.../output.json | 302 ++++++++++
.../options.json | 3 +-
.../output.json | 353 +++++++++++
.../options.json | 3 +-
.../output.json | 214 +++++++
.../options.json | 3 +-
.../output.json | 215 +++++++
.../options.json | 3 +-
.../output.json | 412 +++++++++++++
.../options.json | 3 +-
.../output.json | 266 +++++++++
.../options.json | 3 +-
.../output.json | 196 ++++++
.../options.json | 3 +-
.../output.json | 287 +++++++++
.../options.json | 3 +-
.../output.json | 169 ++++++
.../options.json | 3 +-
.../output.json | 215 +++++++
.../1/options.json | 3 -
.../1/output.json | 91 +++
.../10/options.json | 3 -
.../10/output.json | 132 +++++
.../11/options.json | 3 -
.../11/output.json | 132 +++++
.../12/options.json | 3 -
.../12/output.json | 172 ++++++
.../13/options.json | 3 -
.../13/output.json | 91 +++
.../14/options.json | 3 -
.../14/output.json | 132 +++++
.../15/options.json | 3 -
.../15/output.json | 132 +++++
.../16/options.json | 3 -
.../16/output.json | 172 ++++++
.../17/options.json | 3 -
.../17/output.json | 91 +++
.../18/options.json | 3 -
.../18/output.json | 132 +++++
.../19/options.json | 3 -
.../19/output.json | 132 +++++
.../2/options.json | 3 -
.../2/output.json | 132 +++++
.../20/options.json | 3 -
.../20/output.json | 172 ++++++
.../21/options.json | 3 -
.../21/output.json | 91 +++
.../22/options.json | 3 -
.../22/output.json | 132 +++++
.../23/options.json | 3 -
.../23/output.json | 132 +++++
.../24/options.json | 3 -
.../24/output.json | 172 ++++++
.../25/options.json | 3 -
.../25/output.json | 91 +++
.../26/options.json | 3 -
.../26/output.json | 132 +++++
.../27/options.json | 3 -
.../27/output.json | 132 +++++
.../28/options.json | 3 -
.../28/output.json | 172 ++++++
.../29/options.json | 3 -
.../29/output.json | 91 +++
.../3/options.json | 3 -
.../3/output.json | 132 +++++
.../30/options.json | 3 -
.../30/output.json | 132 +++++
.../31/options.json | 3 -
.../31/output.json | 132 +++++
.../32/options.json | 3 -
.../32/output.json | 172 ++++++
.../33/options.json | 3 -
.../33/output.json | 91 +++
.../34/options.json | 3 -
.../34/output.json | 132 +++++
.../35/options.json | 3 -
.../35/output.json | 132 +++++
.../36/options.json | 3 -
.../36/output.json | 172 ++++++
.../37/options.json | 3 -
.../37/output.json | 91 +++
.../38/options.json | 3 -
.../38/output.json | 132 +++++
.../39/options.json | 3 -
.../39/output.json | 132 +++++
.../4/options.json | 3 -
.../4/output.json | 172 ++++++
.../40/options.json | 3 -
.../40/output.json | 172 ++++++
.../41/options.json | 3 -
.../41/output.json | 91 +++
.../42/options.json | 3 -
.../42/output.json | 132 +++++
.../43/options.json | 3 -
.../43/output.json | 132 +++++
.../44/options.json | 3 -
.../44/output.json | 172 ++++++
.../45/options.json | 3 -
.../45/output.json | 91 +++
.../46/options.json | 3 -
.../46/output.json | 132 +++++
.../47/options.json | 3 -
.../47/output.json | 132 +++++
.../48/options.json | 3 -
.../48/output.json | 172 ++++++
.../49/options.json | 3 -
.../49/output.json | 91 +++
.../5/options.json | 3 -
.../5/output.json | 91 +++
.../50/options.json | 3 -
.../50/output.json | 132 +++++
.../51/options.json | 3 -
.../51/output.json | 132 +++++
.../52/options.json | 3 -
.../52/output.json | 172 ++++++
.../53/options.json | 3 -
.../53/output.json | 91 +++
.../54/options.json | 3 -
.../54/output.json | 132 +++++
.../55/options.json | 3 -
.../55/output.json | 132 +++++
.../56/options.json | 3 -
.../56/output.json | 172 ++++++
.../57/options.json | 3 -
.../57/output.json | 91 +++
.../58/options.json | 3 -
.../58/output.json | 132 +++++
.../59/options.json | 3 -
.../59/output.json | 132 +++++
.../6/options.json | 3 -
.../6/output.json | 132 +++++
.../60/options.json | 3 -
.../60/output.json | 172 ++++++
.../61/options.json | 3 -
.../61/output.json | 91 +++
.../62/options.json | 3 -
.../62/output.json | 132 +++++
.../63/options.json | 3 -
.../63/output.json | 132 +++++
.../64/options.json | 3 -
.../64/output.json | 172 ++++++
.../65/options.json | 3 -
.../65/output.json | 91 +++
.../66/options.json | 3 -
.../66/output.json | 132 +++++
.../67/options.json | 3 -
.../67/output.json | 132 +++++
.../68/options.json | 3 -
.../68/output.json | 172 ++++++
.../7/options.json | 3 -
.../7/output.json | 132 +++++
.../8/options.json | 3 -
.../8/output.json | 172 ++++++
.../9/options.json | 3 -
.../9/output.json | 91 +++
.../top-level-await/inside-arrow/options.json | 1 +
.../inside-function/options.json | 1 +
.../options.json | 10 +-
.../output.json | 172 ++++++
.../options.json | 3 -
.../output.json | 73 +++
.../invalid-commonjs-module/options.json | 3 -
.../invalid-commonjs-module/output.json | 214 +++++++
.../invalid-es-module/options.json | 3 -
.../invalid-es-module/output.json | 214 +++++++
.../invalid-import/options.json | 3 -
.../declare-module/invalid-import/output.json | 161 +++++
.../invalid-module-in-module/options.json | 3 -
.../invalid-module-in-module/output.json | 137 +++++
.../invalid-multiple-commonjs/options.json | 3 -
.../invalid-multiple-commonjs/output.json | 181 ++++++
.../options.json | 3 +-
.../output.json | 87 +++
.../options.json | 3 +-
.../output.json | 136 +++++
.../duplicate-member-name/options.json | 3 +-
.../duplicate-member-name/output.json | 152 +++++
.../flow/enum-declaration/export/options.json | 9 +-
.../options.json | 3 +-
.../output.json | 87 +++
.../options.json | 3 +-
.../output.json | 87 +++
.../options.json | 6 +-
.../output.json | 87 +++
.../options.json | 3 +-
.../output.json | 87 +++
.../options.json | 3 +-
.../output.json | 86 +++
.../options.json | 3 +-
.../output.json | 87 +++
.../options.json | 3 +-
.../output.json | 87 +++
.../options.json | 2 +-
.../options.json | 3 +-
.../output.json | 87 +++
.../options.json | 3 +-
.../output.json | 87 +++
.../invalid-member-name/options.json | 3 +-
.../invalid-member-name/output.json | 153 +++++
.../options.json | 3 +-
.../output.json | 87 +++
.../options.json | 3 +-
.../output.json | 140 +++++
.../reserved-word-enum-name/options.json | 3 +-
.../reserved-word-enum-name/output.json | 87 +++
.../options.json | 3 +-
.../output.json | 152 +++++
.../options.json | 3 +-
.../output.json | 192 ++++++
.../options.json | 4 +-
.../output.json | 130 ++++
.../options.json | 4 +-
.../output.json | 184 ++++++
.../options.json | 3 +-
.../output.json | 185 ++++++
.../options.json | 3 +-
.../output.json | 238 ++++++++
.../options.json | 5 -
.../output.json | 184 ++++++
.../options.json | 3 +-
.../output.json | 185 ++++++
.../options.json | 3 +-
.../output.json | 238 ++++++++
.../options.json | 3 +-
.../output.json | 182 ++++++
.../options.json | 3 +-
.../output.json | 182 ++++++
.../options.json | 3 +-
.../output.json | 235 ++++++++
.../options.json | 3 +-
.../output.json | 182 ++++++
.../options.json | 3 +-
.../output.json | 230 ++++++++
.../id-reserved-type-invalid/options.json | 3 -
.../id-reserved-type-invalid/output.json | 94 +++
.../options.json | 3 -
.../output.json | 122 ++++
.../fixtures/flow/iterator/03/options.json | 3 -
.../fixtures/flow/iterator/03/output.json | 89 +++
.../fixtures/flow/iterator/04/options.json | 3 -
.../fixtures/flow/iterator/04/output.json | 89 +++
.../fixtures/flow/iterator/05/options.json | 3 -
.../fixtures/flow/iterator/05/output.json | 144 +++++
.../fixtures/flow/iterator/06/options.json | 3 -
.../fixtures/flow/iterator/06/output.json | 144 +++++
.../fixtures/flow/iterator/07/options.json | 3 -
.../fixtures/flow/iterator/07/output.json | 86 +++
.../fixtures/flow/iterator/08/options.json | 3 -
.../fixtures/flow/iterator/08/output.json | 86 +++
.../fixtures/flow/iterator/09/options.json | 3 -
.../fixtures/flow/iterator/09/output.json | 161 +++++
.../fixtures/flow/iterator/10/options.json | 3 -
.../fixtures/flow/iterator/10/output.json | 161 +++++
.../fixtures/flow/iterator/11/options.json | 3 -
.../fixtures/flow/iterator/11/output.json | 161 +++++
.../multiple-declarations/class/options.json | 3 +-
.../multiple-declarations/class/output.json | 143 +++++
.../interface/options.json | 3 +-
.../interface/output.json | 180 ++++++
.../multiple-declarations/type/options.json | 3 +-
.../multiple-declarations/type/output.json | 134 +++++
.../options.json | 3 -
.../output.json | 212 +++++++
.../invalid-getter-param-count/options.json | 3 -
.../invalid-getter-param-count/output.json | 212 +++++++
.../invalid-setter-param-count/options.json | 3 -
.../invalid-setter-param-count/output.json | 163 +++++
.../invalid-setter-param-type/options.json | 3 -
.../invalid-setter-param-type/output.json | 212 +++++++
.../reserved-type-invalid/options.json | 3 -
.../reserved-type-invalid/output.json | 87 +++
.../flow/optional-type/6/options.json | 3 -
.../fixtures/flow/optional-type/6/output.json | 124 ++++
.../fixtures/flow/predicates/4/options.json | 3 -
.../fixtures/flow/predicates/4/output.json | 241 ++++++++
.../fixtures/flow/predicates/5/options.json | 3 -
.../fixtures/flow/predicates/5/output.json | 210 +++++++
.../issue-58-ambiguous/options.json | 2 +-
.../issue-58-failing-1/options.json | 3 -
.../regression/issue-58-failing-1/output.json | 233 ++++++++
.../issue-58-failing-2/options.json | 3 -
.../regression/issue-58-failing-2/output.json | 353 +++++++++++
.../issue-58-failing-3/options.json | 3 -
.../regression/issue-58-failing-3/output.json | 270 +++++++++
.../issue-58-failing-4/options.json | 3 -
.../regression/issue-58-failing-4/output.json | 270 +++++++++
.../options.json | 8 +-
.../dupl-decl-const-declare-class/output.json | 164 ++++++
.../options.json | 8 +-
.../output.json | 164 ++++++
.../dupl-decl-const-interface/options.json | 8 +-
.../dupl-decl-const-interface/output.json | 164 ++++++
.../dupl-decl-const-opaque-type/options.json | 3 -
.../dupl-decl-const-opaque-type/output.json | 163 +++++
.../scope/dupl-decl-const-type/options.json | 3 -
.../scope/dupl-decl-const-type/output.json | 162 +++++
.../options.json | 8 +-
.../output.json | 150 +++++
.../options.json | 8 +-
.../output.json | 150 +++++
.../dupl-decl-declare-var-let/options.json | 8 +-
.../dupl-decl-declare-var-let/output.json | 151 +++++
.../options.json | 8 +-
.../dupl-decl-interface-interface/output.json | 150 +++++
.../dupl-decl-let-declare-class/options.json | 8 +-
.../dupl-decl-let-declare-class/output.json | 164 ++++++
.../options.json | 8 +-
.../output.json | 164 ++++++
.../dupl-decl-let-interface/options.json | 8 +-
.../scope/dupl-decl-let-interface/output.json | 164 ++++++
.../dupl-decl-let-opaque-type/options.json | 3 -
.../dupl-decl-let-opaque-type/output.json | 163 +++++
.../scope/dupl-decl-let-type/options.json | 3 -
.../flow/scope/dupl-decl-let-type/output.json | 162 +++++
.../dupl-decl-opaque-type-const/options.json | 3 -
.../dupl-decl-opaque-type-const/output.json | 163 +++++
.../dupl-decl-opaque-type-let/options.json | 3 -
.../dupl-decl-opaque-type-let/output.json | 163 +++++
.../options.json | 3 -
.../output.json | 148 +++++
.../dupl-decl-opaque-type-type/options.json | 3 -
.../dupl-decl-opaque-type-type/output.json | 147 +++++
.../dupl-decl-opaque-type-var/options.json | 3 -
.../dupl-decl-opaque-type-var/output.json | 163 +++++
.../scope/dupl-decl-type-const/options.json | 3 -
.../scope/dupl-decl-type-const/output.json | 162 +++++
.../dupl-decl-type-interface/options.json | 8 +-
.../dupl-decl-type-interface/output.json | 142 +++++
.../scope/dupl-decl-type-let/options.json | 3 -
.../flow/scope/dupl-decl-type-let/output.json | 162 +++++
.../dupl-decl-type-opaque-type/options.json | 3 -
.../dupl-decl-type-opaque-type/output.json | 147 +++++
.../scope/dupl-decl-type-type/options.json | 3 -
.../scope/dupl-decl-type-type/output.json | 146 +++++
.../scope/dupl-decl-type-var/options.json | 3 -
.../flow/scope/dupl-decl-type-var/output.json | 162 +++++
.../options.json | 8 +-
.../output.json | 164 ++++++
.../dupl-decl-var-interface/options.json | 8 +-
.../scope/dupl-decl-var-interface/output.json | 164 ++++++
.../dupl-decl-var-opaque-type/options.json | 3 -
.../dupl-decl-var-opaque-type/output.json | 163 +++++
.../scope/dupl-decl-var-type/options.json | 3 -
.../flow/scope/dupl-decl-var-type/output.json | 162 +++++
.../flow/type-annotations/131/options.json | 3 -
.../flow/type-annotations/131/output.json | 86 +++
.../flow/type-annotations/132/options.json | 3 -
.../flow/type-annotations/132/output.json | 119 ++++
.../flow/type-annotations/133/options.json | 3 -
.../flow/type-annotations/133/output.json | 236 ++++++++
.../flow/type-annotations/134/options.json | 3 -
.../flow/type-annotations/134/output.json | 86 +++
.../flow/type-annotations/137/options.json | 3 -
.../flow/type-annotations/137/output.json | 140 +++++
.../flow/type-annotations/139/options.json | 3 -
.../flow/type-annotations/139/output.json | 190 ++++++
.../with-default-invalid/options.json | 3 -
.../with-default-invalid/output.json | 173 ++++++
.../invalid-import-type-2/options.json | 3 -
.../invalid-import-type-2/output.json | 126 ++++
.../invalid-import-type-3/options.json | 3 -
.../invalid-import-type-3/output.json | 108 ++++
.../invalid-import-type-4/options.json | 3 -
.../invalid-import-type-4/output.json | 108 ++++
.../invalid-import-type-as/options.json | 8 +-
.../invalid-import-type-as/output.json | 126 ++++
.../options.json | 3 -
.../output.json | 126 ++++
.../options.json | 3 -
.../output.json | 126 ++++
.../options.json | 3 -
.../output.json | 126 ++++
.../options.json | 3 -
.../invalid-import-type-shorthand/output.json | 126 ++++
.../invalid-import-type/options.json | 3 -
.../invalid-import-type/output.json | 108 ++++
.../default-missing/options.json | 3 -
.../default-missing/output.json | 169 ++++++
.../options.json | 9 +-
.../output.json | 94 +++
.../options.json | 5 -
.../output.json | 241 ++++++++
.../options.json | 3 +-
.../output.json | 122 ++++
.../options.json | 5 -
.../output.json | 174 ++++++
.../fail-in-calls-with-one-arg/options.json | 3 -
.../fail-in-calls-with-one-arg/output.json | 149 +++++
.../flow/typecasts/fail-in-calls/options.json | 3 -
.../flow/typecasts/fail-in-calls/output.json | 166 ++++++
.../fail-without-parens/options.json | 3 -
.../typecasts/fail-without-parens/output.json | 171 ++++++
.../fails-in-array-expression-1/options.json | 3 -
.../fails-in-array-expression-1/output.json | 132 +++++
.../fails-in-array-expression-2/options.json | 3 -
.../fails-in-array-expression-2/output.json | 136 +++++
.../fails-in-array-expression-3/options.json | 3 -
.../fails-in-array-expression-3/output.json | 170 ++++++
.../fails-in-array-expression-4/options.json | 3 -
.../fails-in-array-expression-4/output.json | 166 ++++++
.../fails-in-array-expression-5/options.json | 3 -
.../fails-in-array-expression-5/output.json | 200 +++++++
.../jsx/errors/adjacent-tags/options.json | 3 -
.../jsx/errors/adjacent-tags/output.json | 189 ++++++
.../attribute-empty-expression/options.json | 3 -
.../attribute-empty-expression/output.json | 165 ++++++
.../wrong-closing-tag-fragment/options.json | 3 -
.../wrong-closing-tag-fragment/output.json | 115 ++++
.../jsx/errors/wrong-closing-tag/options.json | 3 -
.../jsx/errors/wrong-closing-tag/output.json | 133 +++++
.../wrong-opening-tag-fragment/options.json | 3 -
.../wrong-opening-tag-fragment/output.json | 117 ++++
.../_errors/space-after/options.json | 3 +-
.../_errors/space-after/output.json | 71 +++
.../_errors/space-before/options.json | 3 +-
.../_errors/space-before/output.json | 71 +++
.../arrow-async-parameter-as/options.json | 3 -
.../cast/arrow-async-parameter-as/output.json | 154 +++++
.../options.json | 3 -
.../output.json | 154 +++++
.../cast/arrow-parameter-as/options.json | 3 -
.../cast/arrow-parameter-as/output.json | 154 +++++
.../arrow-parameter-assertion/options.json | 3 -
.../arrow-parameter-assertion/output.json | 154 +++++
.../class/extends-empty/options.json | 3 -
.../class/extends-empty/output.json | 87 +++
.../extends-implements-empty/options.json | 3 -
.../extends-implements-empty/output.json | 104 ++++
.../class/implements-empty/options.json | 3 -
.../class/implements-empty/output.json | 88 +++
.../options.json | 3 -
.../output.json | 177 ++++++
.../options.json | 3 -
.../output.json | 139 +++++
.../options.json | 3 -
.../output.json | 138 +++++
.../options.json | 3 -
.../output.json | 138 +++++
.../options.json | 3 -
.../output.json | 138 +++++
.../function/pattern-parameters/options.json | 3 -
.../function/pattern-parameters/output.json | 124 ++++
.../redeclaration-class-class/options.json | 3 -
.../redeclaration-class-class/output.json | 136 +++++
.../redeclaration-class-enum/options.json | 3 -
.../redeclaration-class-enum/output.json | 120 ++++
.../redeclaration-class-type/options.json | 3 -
.../redeclaration-class-type/output.json | 134 +++++
.../redeclaration-constenum-enum/options.json | 3 -
.../redeclaration-constenum-enum/output.json | 105 ++++
.../redeclaration-enum-class/options.json | 3 -
.../redeclaration-enum-class/output.json | 120 ++++
.../redeclaration-enum-constenum/options.json | 3 -
.../redeclaration-enum-constenum/output.json | 105 ++++
.../redeclaration-enum-function/options.json | 3 -
.../redeclaration-enum-function/output.json | 123 ++++
.../redeclaration-enum-interface/options.json | 3 -
.../redeclaration-enum-interface/output.json | 119 ++++
.../scope/redeclaration-enum-let/options.json | 3 -
.../scope/redeclaration-enum-let/output.json | 122 ++++
.../redeclaration-enum-type/options.json | 3 -
.../scope/redeclaration-enum-type/output.json | 118 ++++
.../scope/redeclaration-enum-var/options.json | 3 -
.../scope/redeclaration-enum-var/output.json | 122 ++++
.../redeclaration-function-enum/options.json | 3 -
.../redeclaration-function-enum/output.json | 123 ++++
.../redeclaration-interface-enum/options.json | 3 -
.../redeclaration-interface-enum/output.json | 119 ++++
.../scope/redeclaration-let-enum/options.json | 3 -
.../scope/redeclaration-let-enum/output.json | 122 ++++
.../redeclaration-type-class/options.json | 3 -
.../redeclaration-type-class/output.json | 134 +++++
.../redeclaration-type-enum/options.json | 3 -
.../scope/redeclaration-type-enum/output.json | 118 ++++
.../redeclaration-type-interface/options.json | 3 -
.../redeclaration-type-interface/output.json | 133 +++++
.../redeclaration-type-type/options.json | 3 -
.../scope/redeclaration-type-type/output.json | 132 +++++
.../scope/redeclaration-var-enum/options.json | 3 -
.../scope/redeclaration-var-enum/output.json | 122 ++++
.../types/literal-string-2/options.json | 5 -
.../types/literal-string-2/output.json | 195 ++++++
.../typescript/types/read-only-1/options.json | 5 -
.../typescript/types/read-only-1/output.json | 137 +++++
.../typescript/types/read-only-2/options.json | 5 -
.../typescript/types/read-only-2/output.json | 154 +++++
.../typescript/types/read-only-3/options.json | 5 -
.../typescript/types/read-only-3/output.json | 168 ++++++
.../typescript/types/read-only-4/options.json | 5 -
.../typescript/types/read-only-4/output.json | 186 ++++++
.../types/tuple-optional-invalid/options.json | 5 -
.../types/tuple-optional-invalid/output.json | 166 ++++++
.../options.json | 2 +-
.../test/helpers/runFixtureTests.js | 44 +-
.../jsx-compat/ts-invalid/options.json | 2 +-
2224 files changed, 155997 insertions(+), 3354 deletions(-)
delete mode 100644 packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/options.json
create mode 100644 packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json
create mode 100644 packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/scope/for-var/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/for-var/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/108/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/108/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/349/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/349/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/350/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/350/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/351/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/351/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/354/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/354/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/361/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/361/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/362/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/362/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/363/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/363/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/366/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/366/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/367/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/367/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/368/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/368/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/369/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/369/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/370/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/370/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/371/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/371/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/372/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/372/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/373/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/373/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/374/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/374/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/382/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/382/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/383/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/383/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/384/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/384/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/397/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/397/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/398/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/398/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/399/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/399/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/400/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/400/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/401/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/401/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/402/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/402/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/403/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/403/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/404/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/404/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/409/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/409/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/411/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/411/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/417/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/417/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/418/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/418/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/425/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/425/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/427/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/427/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/446/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/446/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/447/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/447/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/448/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/448/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/449/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/449/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/454/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/454/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/455/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/455/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/456/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/456/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/457/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/457/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/459/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/459/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/460/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/460/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/461/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/461/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/462/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/462/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/463/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/463/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/464/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/464/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/465/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/465/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/466/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/466/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/467/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/467/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/468/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/468/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/469/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/469/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/470/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/470/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/471/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/471/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/472/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/472/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/473/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/473/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/474/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/474/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/475/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/475/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/476/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/476/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/477/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/477/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/478/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/478/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/479/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/479/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/480/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/480/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/481/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/481/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/482/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/482/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/483/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/483/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/484/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/484/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/485/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/485/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/486/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/486/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/487/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/487/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/488/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/488/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/489/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/489/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/490/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/490/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/491/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/491/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/492/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/492/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/493/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/493/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/494/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/494/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/495/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/495/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/496/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/496/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/497/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/497/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/498/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/498/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/499/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/499/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/500/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/500/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/501/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/501/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/502/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/502/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/503/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/503/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/504/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/504/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/505/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/505/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/506/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/506/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/507/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/507/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/508/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/508/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/509/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/509/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/510/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/510/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/511/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/511/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/512/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/512/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/513/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/513/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/514/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/514/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/515/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/515/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/516/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/516/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/517/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/517/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/518/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/518/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/519/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/519/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/520/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/520/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/521/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/521/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/522/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/522/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/523/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/523/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/524/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/524/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/544/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/544/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/545/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/547/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/547/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/548/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/550/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/550/output.json
delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/552/options.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/552/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/556/output.json
create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/558/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/class/extends-strict/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/shorthand/1/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/shorthand/2/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/125/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/126/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/127/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/198/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/200/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/201/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/202/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/204/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/205/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/206/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/208/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/209/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/210/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/211/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/213/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/214/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/215/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/217/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/218/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/219/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/220/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/221/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/222/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/223/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/226/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/228/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/229/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/230/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/231/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/232/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/248/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/249/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/251/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/252/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/280/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/281/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/284/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/290/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/291/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/298/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/324/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/325/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/329/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/333/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/339/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/347/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/348/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/349/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/37/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/2/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json
delete mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/options.json
create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json
delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json
create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json
delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json
create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/03/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/03/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/04/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/04/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/05/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/05/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/06/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/06/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/07/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/07/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/08/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/08/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/09/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/09/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/10/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/10/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/11/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/11/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/optional-type/6/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/optional-type/6/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/predicates/4/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/predicates/4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/predicates/5/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/predicates/5/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/131/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/132/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/133/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/134/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/137/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/139/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json
create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json
delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json
create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json
delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/options.json
create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json
delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/options.json
create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json
delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/options.json
create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json
delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/options.json
create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json
create mode 100644 packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json
create mode 100644 packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/literal-string-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-1/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-2/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-3/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-4/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json
diff --git a/packages/babel-core/test/fixtures/parse/output.json b/packages/babel-core/test/fixtures/parse/output.json
index 06fb684869dc..5c48f0e09836 100644
--- a/packages/babel-core/test/fixtures/parse/output.json
+++ b/packages/babel-core/test/fixtures/parse/output.json
@@ -2,6 +2,7 @@
"type": "File",
"start": 0,
"end": 91,
+ "errors": [],
"loc": {
"start": {
"line": 1,
diff --git a/packages/babel-parser/src/options.js b/packages/babel-parser/src/options.js
index 8b030847f970..eb4dd6789605 100755
--- a/packages/babel-parser/src/options.js
+++ b/packages/babel-parser/src/options.js
@@ -21,6 +21,7 @@ export type Options = {
ranges: boolean,
tokens: boolean,
createParenthesizedExpressions: boolean,
+ errorRecovery: boolean,
};
export const defaultOptions: Options = {
@@ -62,6 +63,9 @@ export const defaultOptions: Options = {
// Whether to create ParenthesizedExpression AST nodes (if false
// the parser sets extra.parenthesized on the expression nodes instead).
createParenthesizedExpressions: false,
+ // When enabled, errors are attached to the AST instead of being directly thrown.
+ // Some errors will still throw, because @babel/parser can't always recover.
+ errorRecovery: false,
};
// Interpret and default an options object
diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js
index eb7952a3e8d9..291351594925 100644
--- a/packages/babel-parser/src/parser/expression.js
+++ b/packages/babel-parser/src/parser/expression.js
@@ -108,6 +108,7 @@ export default class ExpressionParser extends LValParser {
this.unexpected();
}
expr.comments = this.state.comments;
+ expr.errors = this.state.errors;
return expr;
}
@@ -786,11 +787,11 @@ export default class ExpressionParser extends LValParser {
if (node.callee.type === "Import") {
if (node.arguments.length !== 1) {
this.raise(node.start, "import() requires exactly one argument");
- }
-
- const importArg = node.arguments[0];
- if (importArg && importArg.type === "SpreadElement") {
- this.raise(importArg.start, "... is not allowed in import()");
+ } else {
+ const importArg = node.arguments[0];
+ if (importArg && importArg.type === "SpreadElement") {
+ this.raise(importArg.start, "... is not allowed in import()");
+ }
}
}
return this.finishNode(
@@ -903,13 +904,6 @@ export default class ExpressionParser extends LValParser {
switch (this.state.type) {
case tt._super:
- if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
- this.raise(
- this.state.start,
- "super is only allowed in object methods and classes",
- );
- }
-
node = this.startNode();
this.next();
if (
@@ -922,6 +916,14 @@ export default class ExpressionParser extends LValParser {
"super() is only valid inside a class constructor of a subclass. " +
"Maybe a typo in the method name ('constructor') or not extending another class?",
);
+ } else if (
+ !this.scope.allowSuper &&
+ !this.options.allowSuperOutsideMethod
+ ) {
+ this.raise(
+ node.start,
+ "super is only allowed in object methods and classes",
+ );
}
if (
@@ -929,7 +931,11 @@ export default class ExpressionParser extends LValParser {
!this.match(tt.bracketL) &&
!this.match(tt.dot)
) {
- this.unexpected();
+ this.raise(
+ node.start,
+ "super can only be used with function calls (i.e. super()) or " +
+ "in property accesses (i.e. super.prop or super[prop])",
+ );
}
return this.finishNode(node, "Super");
@@ -1106,15 +1112,16 @@ export default class ExpressionParser extends LValParser {
}
this.next();
- if (this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) {
- this.registerTopicReference();
- return this.finishNode(node, "PipelinePrimaryTopicReference");
- } else {
- throw this.raise(
+
+ if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) {
+ this.raise(
node.start,
`Topic reference was used in a lexical context without topic binding`,
);
}
+
+ this.registerTopicReference();
+ return this.finishNode(node, "PipelinePrimaryTopicReference");
}
}
@@ -1199,6 +1206,15 @@ export default class ExpressionParser extends LValParser {
if (this.isContextual("meta")) {
this.expectPlugin("importMeta");
+
+ if (!this.inModule) {
+ this.raise(
+ id.start,
+ `import.meta may appear only with 'sourceType: "module"'`,
+ { code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" },
+ );
+ }
+ this.sawUnambiguousESM = true;
} else if (!this.hasPlugin("importMeta")) {
this.raise(
id.start,
@@ -1206,15 +1222,6 @@ export default class ExpressionParser extends LValParser {
);
}
- if (!this.inModule) {
- this.raise(
- id.start,
- `import.meta may appear only with 'sourceType: "module"'`,
- { code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" },
- );
- }
- this.sawUnambiguousESM = true;
-
return this.parseMetaProperty(node, id, "meta");
}
@@ -1386,7 +1393,10 @@ export default class ExpressionParser extends LValParser {
parseNew(): N.NewExpression | N.MetaProperty {
const node = this.startNode();
- const meta = this.parseIdentifier(true);
+
+ let meta = this.startNode();
+ this.next();
+ meta = this.createIdentifier(meta, "new");
if (this.eat(tt.dot)) {
const metaProp = this.parseMetaProperty(node, meta, "target");
@@ -1553,12 +1563,12 @@ export default class ExpressionParser extends LValParser {
this.state.start,
"Stage 2 decorators disallow object literal property decorators",
);
- } else {
- // we needn't check if decorators (stage 0) plugin is enabled since it's checked by
- // the call to this.parseDecorator
- while (this.match(tt.at)) {
- decorators.push(this.parseDecorator());
- }
+ }
+
+ // we needn't check if decorators (stage 0) plugin is enabled since it's checked by
+ // the call to this.parseDecorator
+ while (this.match(tt.at)) {
+ decorators.push(this.parseDecorator());
}
}
@@ -1933,7 +1943,7 @@ export default class ExpressionParser extends LValParser {
if (isExpression) {
node.body = this.parseMaybeAssign();
- this.checkParams(node, false, allowExpression);
+ this.checkParams(node, false, allowExpression, false);
} else {
const nonSimple = !this.isSimpleParamList(node.params);
if (!oldStrict || nonSimple) {
@@ -1967,6 +1977,7 @@ export default class ExpressionParser extends LValParser {
node,
!oldStrict && !useStrict && !allowExpression && !isMethod && !nonSimple,
allowExpression,
+ !oldStrict && useStrict,
);
node.body = this.parseBlock(true, false);
this.state.labels = oldLabels;
@@ -1975,7 +1986,14 @@ export default class ExpressionParser extends LValParser {
this.state.inParameters = oldInParameters;
// Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
if (this.state.strict && node.id) {
- this.checkLVal(node.id, BIND_OUTSIDE, undefined, "function name");
+ this.checkLVal(
+ node.id,
+ BIND_OUTSIDE,
+ undefined,
+ "function name",
+ undefined,
+ !oldStrict && useStrict,
+ );
}
this.state.strict = oldStrict;
}
@@ -1994,6 +2012,7 @@ export default class ExpressionParser extends LValParser {
allowDuplicates: boolean,
// eslint-disable-next-line no-unused-vars
isArrowFunction: ?boolean,
+ strictModeChanged?: boolean = true,
): void {
// $FlowIssue
const nameHash: {} = Object.create(null);
@@ -2003,6 +2022,8 @@ export default class ExpressionParser extends LValParser {
BIND_VAR,
allowDuplicates ? null : nameHash,
"function parameter list",
+ undefined,
+ strictModeChanged,
);
}
}
@@ -2084,6 +2105,8 @@ export default class ExpressionParser extends LValParser {
// Parse the next token as an identifier. If `liberal` is true (used
// when parsing properties), it will also convert keywords into
// identifiers.
+ // This shouldn't be used to parse the keywords of meta properties, since they
+ // are not identifiers and cannot contain escape sequences.
parseIdentifier(liberal?: boolean): N.Identifier {
const node = this.startNode();
@@ -2104,11 +2127,6 @@ export default class ExpressionParser extends LValParser {
if (this.match(tt.name)) {
name = this.state.value;
-
- // An escaped identifier whose value is the same as a keyword
- if (!liberal && this.state.containsEsc && isKeyword(name)) {
- this.raise(this.state.pos, `Escape sequence in keyword ${name}`);
- }
} else if (this.state.type.keyword) {
name = this.state.type.keyword;
@@ -2128,7 +2146,11 @@ export default class ExpressionParser extends LValParser {
throw this.unexpected();
}
- if (!liberal) {
+ if (liberal) {
+ // If the current token is not used as a keyword, set its type to "tt.name".
+ // This will prevent this.next() from throwing about unexpected escapes.
+ this.state.type = tt.name;
+ } else {
this.checkReservedWord(
name,
this.state.start,
@@ -2153,6 +2175,7 @@ export default class ExpressionParser extends LValParser {
startLoc,
"Can not use 'yield' as identifier inside a generator",
);
+ return;
}
if (word === "await") {
@@ -2161,7 +2184,9 @@ export default class ExpressionParser extends LValParser {
startLoc,
"Can not use 'await' as identifier inside an async function",
);
- } else if (
+ return;
+ }
+ if (
this.state.awaitPos === -1 &&
(this.state.maybeInArrowParameters || this.isAwaitAllowed())
) {
@@ -2174,9 +2199,11 @@ export default class ExpressionParser extends LValParser {
startLoc,
"'arguments' is not allowed in class field initializer",
);
+ return;
}
if (checkKeywords && isKeyword(word)) {
this.raise(startLoc, `Unexpected keyword '${word}'`);
+ return;
}
const reservedTest = !this.state.strict
@@ -2191,8 +2218,9 @@ export default class ExpressionParser extends LValParser {
startLoc,
"Can not use keyword 'await' outside an async function",
);
+ } else {
+ this.raise(startLoc, `Unexpected reserved word '${word}'`);
}
- this.raise(startLoc, `Unexpected reserved word '${word}'`);
}
}
@@ -2206,9 +2234,6 @@ export default class ExpressionParser extends LValParser {
// Parses await expression inside async function.
parseAwait(): N.AwaitExpression {
- if (this.state.awaitPos === -1) {
- this.state.awaitPos = this.state.start;
- }
const node = this.startNode();
this.next();
@@ -2218,8 +2243,10 @@ export default class ExpressionParser extends LValParser {
node.start,
"await is not allowed in async function parameters",
);
+ } else if (this.state.awaitPos === -1) {
+ this.state.awaitPos = node.start;
}
- if (this.match(tt.star)) {
+ if (this.eat(tt.star)) {
this.raise(
node.start,
"await* has been removed from the async functions proposal. Use Promise.all() instead.",
@@ -2259,13 +2286,12 @@ export default class ExpressionParser extends LValParser {
// Parses yield expression inside generator.
parseYield(noIn?: ?boolean): N.YieldExpression {
- if (this.state.yieldPos === -1) {
- this.state.yieldPos = this.state.start;
- }
const node = this.startNode();
if (this.state.inParameters) {
this.raise(node.start, "yield is not allowed in generator parameters");
+ } else if (this.state.yieldPos === -1) {
+ this.state.yieldPos = node.start;
}
this.next();
@@ -2291,7 +2317,7 @@ export default class ExpressionParser extends LValParser {
if (left.type === "SequenceExpression") {
// Ensure that the pipeline head is not a comma-delimited
// sequence expression.
- throw this.raise(
+ this.raise(
leftStartPos,
`Pipeline head should not be a comma-separated sequence expression`,
);
@@ -2336,7 +2362,7 @@ export default class ExpressionParser extends LValParser {
pipelineStyle === "PipelineTopicExpression" &&
childExpression.type === "SequenceExpression"
) {
- throw this.raise(
+ this.raise(
startPos,
`Pipeline body may not be a comma-separated sequence expression`,
);
@@ -2362,7 +2388,7 @@ export default class ExpressionParser extends LValParser {
break;
case "PipelineTopicExpression":
if (!this.topicReferenceWasUsedInCurrentTopicContext()) {
- throw this.raise(
+ this.raise(
startPos,
`Pipeline is in topic style but does not use topic reference`,
);
@@ -2370,7 +2396,9 @@ export default class ExpressionParser extends LValParser {
bodyNode.expression = childExpression;
break;
default:
- throw this.raise(startPos, `Unknown pipeline style ${pipelineStyle}`);
+ throw new Error(
+ `Internal @babel/parser error: Unknown pipeline style (${pipelineStyle})`,
+ );
}
return this.finishNode(bodyNode, pipelineStyle);
}
diff --git a/packages/babel-parser/src/parser/index.js b/packages/babel-parser/src/parser/index.js
index 9e75bf6044d3..2c96336f1c13 100644
--- a/packages/babel-parser/src/parser/index.js
+++ b/packages/babel-parser/src/parser/index.js
@@ -39,7 +39,10 @@ export default class Parser extends StatementParser {
const file = this.startNode();
const program = this.startNode();
this.nextToken();
- return this.parseTopLevel(file, program);
+ file.errors = null;
+ this.parseTopLevel(file, program);
+ file.errors = this.state.errors;
+ return file;
}
}
diff --git a/packages/babel-parser/src/parser/location.js b/packages/babel-parser/src/parser/location.js
index 1839f359ae4c..3694a567090a 100644
--- a/packages/babel-parser/src/parser/location.js
+++ b/packages/babel-parser/src/parser/location.js
@@ -10,6 +10,8 @@ import CommentsParser from "./comments";
// message.
export default class LocationParser extends CommentsParser {
+ +isLookahead: boolean;
+
getLocationForPosition(pos: number): Position {
let loc;
if (pos === this.state.start) loc = this.state.startLoc;
@@ -31,7 +33,7 @@ export default class LocationParser extends CommentsParser {
missingPluginNames?: Array,
code?: string,
} = {},
- ): empty {
+ ): Error | empty {
const loc = this.getLocationForPosition(pos);
message += ` (${loc.line}:${loc.column})`;
@@ -47,6 +49,12 @@ export default class LocationParser extends CommentsParser {
if (code !== undefined) {
err.code = code;
}
- throw err;
+
+ if (this.options.errorRecovery) {
+ if (!this.isLookahead) this.state.errors.push(err);
+ return err;
+ } else {
+ throw err;
+ }
}
}
diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js
index 050bb1eda6c1..547441b0ce41 100644
--- a/packages/babel-parser/src/parser/lval.js
+++ b/packages/babel-parser/src/parser/lval.js
@@ -15,7 +15,10 @@ import type {
SpreadElement,
} from "../types";
import type { Pos, Position } from "../util/location";
-import { isStrictBindReservedWord } from "../util/identifier";
+import {
+ isStrictBindOnlyReservedWord,
+ isStrictBindReservedWord,
+} from "../util/identifier";
import { NodeUtils } from "./node";
import { type BindingTypes, BIND_NONE } from "../util/scopeflags";
@@ -37,6 +40,8 @@ export default class LValParser extends NodeUtils {
// Convert existing expression atom to assignable pattern
// if possible.
+ // NOTE: There is a corresponding "isAssignable" method in flow.js.
+ // When this one is updated, please check if also that one needs to be updated.
toAssignable(
node: Node,
@@ -96,15 +101,16 @@ export default class LValParser extends NodeUtils {
break;
case "AssignmentExpression":
- if (node.operator === "=") {
- node.type = "AssignmentPattern";
- delete node.operator;
- } else {
+ if (node.operator !== "=") {
this.raise(
node.left.end,
"Only '=' operator can be used for specifying default value.",
);
}
+
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left, isBinding, contextDescription);
break;
case "ParenthesizedExpression":
@@ -118,14 +124,9 @@ export default class LValParser extends NodeUtils {
case "MemberExpression":
if (!isBinding) break;
- default: {
- const message =
- "Invalid left-hand side" +
- (contextDescription
- ? " in " + contextDescription
- : /* istanbul ignore next */ "expression");
- this.raise(node.start, message);
- }
+ default:
+ // We don't know how to deal with this node. It will
+ // be reported by a later call to checkLVal
}
}
return node;
@@ -349,12 +350,18 @@ export default class LValParser extends NodeUtils {
checkClashes: ?{ [key: string]: boolean },
contextDescription: string,
disallowLetBinding?: boolean,
+ strictModeChanged?: boolean = false,
): void {
switch (expr.type) {
case "Identifier":
if (
this.state.strict &&
- isStrictBindReservedWord(expr.name, this.inModule)
+ // "Global" reserved words have already been checked by parseIdentifier,
+ // unless they have been found in the id or parameters of a strict-mode
+ // function in a sloppy context.
+ (strictModeChanged
+ ? isStrictBindReservedWord(expr.name, this.inModule)
+ : isStrictBindOnlyReservedWord(expr.name))
) {
this.raise(
expr.start,
@@ -404,6 +411,11 @@ export default class LValParser extends NodeUtils {
case "ObjectPattern":
for (let prop of expr.properties) {
if (prop.type === "ObjectProperty") prop = prop.value;
+ // If we find here an ObjectMethod, it's because this was originally
+ // an ObjectExpression which has then been converted.
+ // toAssignable already reported this error with a nicer message.
+ else if (prop.type === "ObjectMethod") continue;
+
this.checkLVal(
prop,
bindingType,
@@ -489,7 +501,7 @@ export default class LValParser extends NodeUtils {
}
raiseRestNotLast(pos: number) {
- this.raise(pos, `Rest element must be last element`);
+ throw this.raise(pos, `Rest element must be last element`);
}
raiseTrailingCommaAfterRest(pos: number) {
diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js
index 9d87c3d27ed2..827cedfbd7d9 100644
--- a/packages/babel-parser/src/parser/statement.js
+++ b/packages/babel-parser/src/parser/statement.js
@@ -203,7 +203,7 @@ export default class StatementParser extends ExpressionParser {
case tt._var:
kind = kind || this.state.value;
if (context && kind !== "var") {
- this.unexpected(
+ this.raise(
this.state.start,
"Lexical declaration cannot appear in a single-statement context",
);
@@ -269,8 +269,8 @@ export default class StatementParser extends ExpressionParser {
default: {
if (this.isAsyncFunction()) {
if (context) {
- this.unexpected(
- null,
+ this.raise(
+ this.state.start,
"Async functions can only be declared at the top level or inside a block",
);
}
@@ -351,7 +351,7 @@ export default class StatementParser extends ExpressionParser {
);
}
} else if (!this.canHaveLeadingDecorator()) {
- this.raise(
+ throw this.raise(
this.state.start,
"Leading decorators must be attached to a class declaration",
);
@@ -1036,7 +1036,7 @@ export default class StatementParser extends ExpressionParser {
this.initFunction(node, isAsync);
if (this.match(tt.star) && isHangingStatement) {
- this.unexpected(
+ this.raise(
this.state.start,
"Generators can only be declared at the top level or inside a block",
);
@@ -1077,10 +1077,10 @@ export default class StatementParser extends ExpressionParser {
this.scope.exit();
if (isStatement && !isHangingStatement) {
- // We need to validate this _after_ parsing the function body
+ // We need to register this _after_ parsing the function body
// because of TypeScript body-less function declarations,
// which shouldn't be added to the scope.
- this.checkFunctionStatementId(node);
+ this.registerFunctionStatementId(node);
}
this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
@@ -1111,22 +1111,21 @@ export default class StatementParser extends ExpressionParser {
this.checkYieldAwaitInDefaultParams();
}
- checkFunctionStatementId(node: N.Function): void {
+ registerFunctionStatementId(node: N.Function): void {
if (!node.id) return;
// If it is a regular function declaration in sloppy mode, then it is
// subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
// mode depends on properties of the current scope (see
// treatFunctionsAsVar).
- this.checkLVal(
- node.id,
+ this.scope.declareName(
+ node.id.name,
this.state.strict || node.generator || node.async
? this.scope.treatFunctionsAsVar
? BIND_VAR
: BIND_LEXICAL
: BIND_FUNCTION,
- null,
- "function name",
+ node.id.start,
);
}
@@ -1191,7 +1190,7 @@ export default class StatementParser extends ExpressionParser {
while (!this.eat(tt.braceR)) {
if (this.eat(tt.semi)) {
if (decorators.length > 0) {
- this.raise(
+ throw this.raise(
this.state.lastTokEnd,
"Decorators must not be followed by a semicolon",
);
@@ -1229,7 +1228,7 @@ export default class StatementParser extends ExpressionParser {
});
if (decorators.length) {
- this.raise(
+ throw this.raise(
this.state.start,
"You have trailing decorators with no method",
);
@@ -1362,13 +1361,6 @@ export default class StatementParser extends ExpressionParser {
if (isConstructor) {
publicMethod.kind = "constructor";
- if (publicMethod.decorators) {
- this.raise(
- publicMethod.start,
- "You can't attach decorators to a class constructor",
- );
- }
-
// TypeScript allows multiple overloaded constructor declarations.
if (state.hadConstructor && !this.hasPlugin("typescript")) {
this.raise(key.start, "Duplicate constructor in the same class");
@@ -1797,7 +1789,7 @@ export default class StatementParser extends ExpressionParser {
this.hasPlugin("decorators") &&
this.getPluginOption("decorators", "decoratorsBeforeExport")
) {
- this.unexpected(
+ this.raise(
this.state.start,
"Decorators must be placed *before* the 'export' keyword." +
" You can set the 'decoratorsBeforeExport' option to false to use" +
@@ -1807,7 +1799,7 @@ export default class StatementParser extends ExpressionParser {
this.parseDecorators(false);
return this.parseClass(expr, true, true);
} else if (this.match(tt._const) || this.match(tt._var) || this.isLet()) {
- return this.raise(
+ throw this.raise(
this.state.start,
"Only expressions, functions or classes are allowed as the `default` export.",
);
@@ -1977,7 +1969,7 @@ export default class StatementParser extends ExpressionParser {
name: string,
): void {
if (this.state.exportedIdentifiers.indexOf(name) > -1) {
- throw this.raise(
+ this.raise(
node.start,
name === "default"
? "Only one default export allowed per module."
@@ -2098,8 +2090,8 @@ export default class StatementParser extends ExpressionParser {
} else {
// Detect an attempt to deep destructure
if (this.eat(tt.colon)) {
- this.unexpected(
- null,
+ throw this.raise(
+ this.state.start,
"ES2015 named imports do not destructure. " +
"Use another statement for destructuring after the import.",
);
diff --git a/packages/babel-parser/src/parser/util.js b/packages/babel-parser/src/parser/util.js
index d66671551ee2..f1093f31b57f 100644
--- a/packages/babel-parser/src/parser/util.js
+++ b/packages/babel-parser/src/parser/util.js
@@ -2,6 +2,7 @@
import { types as tt, type TokenType } from "../tokenizer/types";
import Tokenizer from "../tokenizer";
+import State from "../tokenizer/state";
import type { Node } from "../types";
import { lineBreak, skipWhiteSpace } from "../util/whitespace";
import { isIdentifierChar } from "../util/identifier";
@@ -9,6 +10,14 @@ import * as charCodes from "charcodes";
const literal = /^('|")((?:\\?.)*?)\1/;
+type TryParse = {
+ node: Node,
+ error: Error,
+ thrown: Thrown,
+ aborted: Aborted,
+ failState: FailState,
+};
+
// ## Parser utilities
export default class UtilParser extends Tokenizer {
@@ -215,4 +224,58 @@ export default class UtilParser extends Tokenizer {
return false;
}
+
+ // tryParse will clone parser state.
+ // It is expensive and should be used with cautions
+ tryParse>(
+ fn: (abort: (node?: T) => empty) => T,
+ oldState: State = this.state.clone(),
+ ):
+ | TryParse
+ | TryParse
+ | TryParse {
+ const abortSignal: { node: T | null } = { node: null };
+ try {
+ const node = fn((node = null) => {
+ abortSignal.node = node;
+ throw abortSignal;
+ });
+ if (this.state.errors.length > oldState.errors.length) {
+ const failState = this.state;
+ this.state = oldState;
+ return {
+ node,
+ error: (failState.errors[oldState.errors.length]: SyntaxError),
+ thrown: false,
+ aborted: false,
+ failState,
+ };
+ }
+
+ return {
+ node,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null,
+ };
+ } catch (error) {
+ const failState = this.state;
+ this.state = oldState;
+ if (error instanceof SyntaxError) {
+ return { node: null, error, thrown: true, aborted: false, failState };
+ }
+ if (error === abortSignal) {
+ return {
+ node: abortSignal.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState,
+ };
+ }
+
+ throw error;
+ }
+ }
}
diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js
index 014a1a54067d..60bc1effffa7 100644
--- a/packages/babel-parser/src/plugins/estree.js
+++ b/packages/babel-parser/src/plugins/estree.js
@@ -93,9 +93,10 @@ export default (superClass: Class): Class =>
} else {
this.raise(start, "setter must have exactly one formal parameter");
}
- }
-
- if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
+ } else if (
+ prop.kind === "set" &&
+ prop.value.params[0].type === "RestElement"
+ ) {
this.raise(
start,
"setter function argument must not be a rest parameter",
@@ -382,12 +383,15 @@ export default (superClass: Class): Class =>
isLast: boolean,
) {
if (prop.kind === "get" || prop.kind === "set") {
- this.raise(
+ throw this.raise(
prop.key.start,
"Object pattern can't contain getter or setter",
);
} else if (prop.method) {
- this.raise(prop.key.start, "Object pattern can't contain methods");
+ throw this.raise(
+ prop.key.start,
+ "Object pattern can't contain methods",
+ );
} else {
super.toAssignableObjectExpressionProp(prop, isBinding, isLast);
}
diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js
index fcdd16df61d2..5e7187455da2 100644
--- a/packages/babel-parser/src/plugins/flow.js
+++ b/packages/babel-parser/src/plugins/flow.js
@@ -1,5 +1,7 @@
// @flow
+/*:: declare var invariant; */
+
import type Parser from "../parser";
import { types as tt, type TokenType } from "../tokenizer/types";
import * as N from "../types";
@@ -263,7 +265,7 @@ export default (superClass: Class): Class =>
return this.flowParseDeclareModuleExports(node);
} else {
if (insideModule) {
- this.unexpected(
+ this.raise(
this.state.lastTokStart,
"`declare module` cannot be used inside another `declare module`",
);
@@ -313,7 +315,7 @@ export default (superClass: Class): Class =>
if (this.match(tt._import)) {
this.next();
if (!this.isContextual("type") && !this.match(tt._typeof)) {
- this.unexpected(
+ this.raise(
this.state.lastTokStart,
"Imports within a `declare module` body must always be `import type` or `import typeof`",
);
@@ -345,17 +347,17 @@ export default (superClass: Class): Class =>
body.forEach(bodyElement => {
if (isEsModuleType(bodyElement)) {
if (kind === "CommonJS") {
- this.unexpected(bodyElement.start, errorMessage);
+ this.raise(bodyElement.start, errorMessage);
}
kind = "ES";
} else if (bodyElement.type === "DeclareModuleExports") {
if (hasModuleExport) {
- this.unexpected(
+ this.raise(
bodyElement.start,
"Duplicate `declare module.exports` statement",
);
}
- if (kind === "ES") this.unexpected(bodyElement.start, errorMessage);
+ if (kind === "ES") this.raise(bodyElement.start, errorMessage);
kind = "CommonJS";
hasModuleExport = true;
}
@@ -548,8 +550,8 @@ export default (superClass: Class): Class =>
checkNotUnderscore(word: string) {
if (word === "_") {
- throw this.unexpected(
- null,
+ this.raise(
+ this.state.start,
"`_` is only allowed as a type argument to call or new",
);
}
@@ -632,7 +634,7 @@ export default (superClass: Class): Class =>
node.default = this.flowParseType();
} else {
if (requireDefault) {
- this.unexpected(
+ this.raise(
nodeStart,
// eslint-disable-next-line max-len
"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
@@ -878,6 +880,7 @@ export default (superClass: Class): Class =>
while (!this.match(endDelim)) {
let isStatic = false;
let protoStart: ?number = null;
+ let inexactStart: ?number = null;
const node = this.startNode();
if (allowProto && this.isContextual("proto")) {
@@ -950,17 +953,29 @@ export default (superClass: Class): Class =>
variance,
kind,
allowSpread,
- allowInexact,
+ allowInexact ?? !exact,
);
if (propOrInexact === null) {
inexact = true;
+ inexactStart = this.state.lastTokStart;
} else {
nodeStart.properties.push(propOrInexact);
}
}
this.flowObjectTypeSemicolon();
+
+ if (
+ inexactStart &&
+ !this.match(tt.braceR) &&
+ !this.match(tt.braceBarR)
+ ) {
+ this.raise(
+ inexactStart,
+ "Explicit inexact syntax must appear at the end of an inexact object",
+ );
+ }
}
this.expect(endDelim);
@@ -990,10 +1005,38 @@ export default (superClass: Class): Class =>
allowSpread: boolean,
allowInexact: boolean,
): (N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty) | null {
- if (this.match(tt.ellipsis)) {
+ if (this.eat(tt.ellipsis)) {
+ const isInexactToken =
+ this.match(tt.comma) ||
+ this.match(tt.semi) ||
+ this.match(tt.braceR) ||
+ this.match(tt.braceBarR);
+
+ if (isInexactToken) {
+ if (!allowSpread) {
+ this.raise(
+ this.state.lastTokStart,
+ "Explicit inexact syntax cannot appear in class or interface definitions",
+ );
+ } else if (!allowInexact) {
+ this.raise(
+ this.state.lastTokStart,
+ "Explicit inexact syntax cannot appear inside an explicit exact object type",
+ );
+ }
+ if (variance) {
+ this.raise(
+ variance.start,
+ "Explicit inexact syntax cannot have variance",
+ );
+ }
+
+ return null;
+ }
+
if (!allowSpread) {
- this.unexpected(
- null,
+ this.raise(
+ this.state.lastTokStart,
"Spread operator cannot appear in class or interface definitions",
);
}
@@ -1001,35 +1044,9 @@ export default (superClass: Class): Class =>
this.unexpected(protoStart);
}
if (variance) {
- this.unexpected(
- variance.start,
- "Spread properties cannot have variance",
- );
- }
- this.expect(tt.ellipsis);
- const isInexactToken = this.eat(tt.comma) || this.eat(tt.semi);
-
- if (this.match(tt.braceR)) {
- if (allowInexact) return null;
- this.unexpected(
- null,
- "Explicit inexact syntax is only allowed inside inexact objects",
- );
- }
-
- if (this.match(tt.braceBarR)) {
- this.unexpected(
- null,
- "Explicit inexact syntax cannot appear inside an explicit exact object type",
- );
+ this.raise(variance.start, "Spread properties cannot have variance");
}
- if (isInexactToken) {
- this.unexpected(
- null,
- "Explicit inexact syntax must appear at the end of an inexact object",
- );
- }
node.argument = this.flowParseType();
return this.finishNode(node, "ObjectTypeSpreadProperty");
} else {
@@ -1400,8 +1417,8 @@ export default (superClass: Class): Class =>
);
}
- this.unexpected(
- null,
+ throw this.raise(
+ this.state.start,
`Unexpected token, expected "number" or "bigint"`,
);
}
@@ -1720,23 +1737,23 @@ export default (superClass: Class): Class =>
): N.Expression {
if (!this.match(tt.question)) return expr;
- // only do the expensive clone if there is a question mark
+ // only use the expensive "tryParse" method if there is a question mark
// and if we come from inside parens
if (refNeedsArrowPos) {
- const state = this.state.clone();
- try {
- return super.parseConditional(expr, noIn, startPos, startLoc);
- } catch (err) {
- if (err instanceof SyntaxError) {
- this.state = state;
- refNeedsArrowPos.start = err.pos || this.state.start;
- return expr;
- } else {
- // istanbul ignore next: no such error is expected
- throw err;
- }
+ const result = this.tryParse(() =>
+ super.parseConditional(expr, noIn, startPos, startLoc),
+ );
+
+ if (!result.node) {
+ // $FlowIgnore
+ refNeedsArrowPos.start = result.error.pos || this.state.start;
+ return expr;
}
+
+ if (result.error) this.state = result.failState;
+ return result.node;
}
+
this.expect(tt.question);
const state = this.state.clone();
const originalNoArrowAt = this.state.noArrowAt;
@@ -1776,10 +1793,10 @@ export default (superClass: Class): Class =>
this.state.noArrowAt = noArrowAt.concat(valid[0].start);
({ consequent, failed } = this.tryParseConditionalConsequent());
}
-
- this.getArrowLikeExpressions(consequent, true);
}
+ this.getArrowLikeExpressions(consequent, true);
+
this.state.noArrowAt = originalNoArrowAt;
this.expect(tt.colon);
@@ -1825,19 +1842,7 @@ export default (superClass: Class): Class =>
if (node.type === "ArrowFunctionExpression") {
if (node.typeParameters || !node.returnType) {
// This is an arrow expression without ambiguity, so check its parameters
- this.toAssignableList(
- // node.params is Expression[] instead of $ReadOnlyArray because it
- // has not been converted yet.
- ((node.params: any): N.Expression[]),
- true,
- "arrow function parameters",
- node.extra?.trailingComma,
- );
- // Enter scope, as checkParams defines bindings
- this.scope.enter(functionFlags(false, false) | SCOPE_ARROW);
- // Use super's method to force the parameters to be checked
- super.checkParams(node, false, true);
- this.scope.exit();
+ this.finishArrowValidation(node);
} else {
arrows.push(node);
}
@@ -1849,30 +1854,29 @@ export default (superClass: Class): Class =>
}
if (disallowInvalid) {
- for (let i = 0; i < arrows.length; i++) {
- this.toAssignableList(
- ((node.params: any): N.Expression[]),
- true,
- "arrow function parameters",
- node.extra?.trailingComma,
- );
- }
+ arrows.forEach(node => this.finishArrowValidation(node));
return [arrows, []];
}
- return partition(arrows, node => {
- try {
- this.toAssignableList(
- ((node.params: any): N.Expression[]),
- true,
- "arrow function parameters",
- node.extra?.trailingComma,
- );
- return true;
- } catch (err) {
- return false;
- }
- });
+ return partition(arrows, node =>
+ node.params.every(param => this.isAssignable(param, true)),
+ );
+ }
+
+ finishArrowValidation(node: N.ArrowFunctionExpression) {
+ this.toAssignableList(
+ // node.params is Expression[] instead of $ReadOnlyArray because it
+ // has not been converted yet.
+ ((node.params: any): N.Expression[]),
+ true,
+ "arrow function parameters",
+ node.extra?.trailingComma,
+ );
+ // Enter scope, as checkParams defines bindings
+ this.scope.enter(functionFlags(false, false) | SCOPE_ARROW);
+ // Use super's method to force the parameters to be checked
+ super.checkParams(node, false, true);
+ this.scope.exit();
}
forwardNoArrowParamsConversionAt(node: N.Node, parse: () => T): T {
@@ -2025,6 +2029,49 @@ export default (superClass: Class): Class =>
}
}
+ isAssignable(node: N.Node, isBinding?: boolean): boolean {
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ return true;
+
+ case "ObjectExpression": {
+ const last = node.properties.length - 1;
+ return node.properties.every((prop, i) => {
+ return (
+ prop.type !== "ObjectMethod" &&
+ (i === last || prop.type === "SpreadElement") &&
+ this.isAssignable(prop)
+ );
+ });
+ }
+
+ case "ObjectProperty":
+ return this.isAssignable(node.value);
+
+ case "SpreadElement":
+ return this.isAssignable(node.argument);
+
+ case "ArrayExpression":
+ return node.elements.every(element => this.isAssignable(element));
+
+ case "AssignmentExpression":
+ return node.operator === "=";
+
+ case "ParenthesizedExpression":
+ return this.isAssignable(node.expression);
+
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ return !isBinding;
+
+ default:
+ return false;
+ }
+ }
+
toAssignable(
node: N.Node,
isBinding: ?boolean,
@@ -2253,13 +2300,13 @@ export default (superClass: Class): Class =>
parseAssignableListItemTypes(param: N.Pattern): N.Pattern {
if (this.eat(tt.question)) {
if (param.type !== "Identifier") {
- throw this.raise(
+ this.raise(
param.start,
"A binding pattern parameter cannot be optional in an implementation signature.",
);
}
- param.optional = true;
+ ((param: any): N.Identifier).optional = true;
}
if (this.match(tt.colon)) {
param.typeAnnotation = this.flowParseTypeAnnotation();
@@ -2490,45 +2537,50 @@ export default (superClass: Class): Class =>
afterLeftParse?: Function,
refNeedsArrowPos?: ?Pos,
): N.Expression {
- let jsxError = null;
+ let state = null;
+
+ let jsx;
+
if (
this.hasPlugin("jsx") &&
(this.match(tt.jsxTagStart) || this.isRelational("<"))
) {
- const state = this.state.clone();
- try {
- return super.parseMaybeAssign(
- noIn,
- refShorthandDefaultPos,
- afterLeftParse,
- refNeedsArrowPos,
- );
- } catch (err) {
- if (err instanceof SyntaxError) {
- this.state = state;
-
- // Remove `tc.j_expr` and `tc.j_oTag` from context added
- // by parsing `jsxTagStart` to stop the JSX plugin from
- // messing with the tokens
- const cLength = this.state.context.length;
- if (this.state.context[cLength - 1] === tc.j_oTag) {
- this.state.context.length -= 2;
- }
+ state = this.state.clone();
+
+ jsx = this.tryParse(
+ () =>
+ super.parseMaybeAssign(
+ noIn,
+ refShorthandDefaultPos,
+ afterLeftParse,
+ refNeedsArrowPos,
+ ),
+ state,
+ );
+ /*:: invariant(!jsx.aborted) */
- jsxError = err;
- } else {
- // istanbul ignore next: no such error is expected
- throw err;
- }
+ if (!jsx.error) return jsx.node;
+
+ // Remove `tc.j_expr` and `tc.j_oTag` from context added
+ // by parsing `jsxTagStart` to stop the JSX plugin from
+ // messing with the tokens
+ const { context } = this.state;
+ if (context[context.length - 1] === tc.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === tc.j_expr) {
+ context.length -= 1;
}
}
- if (jsxError != null || this.isRelational("<")) {
- let arrowExpression;
+ if ((jsx && jsx.error) || this.isRelational("<")) {
+ state = state || this.state.clone();
+
let typeParameters;
- try {
+
+ const arrow = this.tryParse(() => {
typeParameters = this.flowParseTypeParameterDeclaration();
- arrowExpression = this.forwardNoArrowParamsConversionAt(
+
+ const arrowExpression = this.forwardNoArrowParamsConversionAt(
typeParameters,
() =>
super.parseMaybeAssign(
@@ -2540,20 +2592,43 @@ export default (superClass: Class): Class =>
);
arrowExpression.typeParameters = typeParameters;
this.resetStartLocationFromNode(arrowExpression, typeParameters);
- } catch (err) {
- throw jsxError || err;
+
+ return arrowExpression;
+ }, state);
+
+ const arrowExpression: ?N.ArrowFunctionExpression =
+ arrow.node && arrow.node.type === "ArrowFunctionExpression"
+ ? arrow.node
+ : null;
+
+ if (!arrow.error && arrowExpression) return arrowExpression;
+
+ // If we are here, both JSX and Flow parsing attemps failed.
+ // Give the precedence to the JSX error, except if JSX had an
+ // unrecoverable error while Flow didn't.
+ // If the error is recoverable, we can only re-report it if there is
+ // a node we can return.
+
+ if (jsx && jsx.node) {
+ /*:: invariant(jsx.failState) */
+ this.state = jsx.failState;
+ return jsx.node;
}
- if (arrowExpression.type === "ArrowFunctionExpression") {
+ if (arrowExpression) {
+ /*:: invariant(arrow.failState) */
+ this.state = arrow.failState;
return arrowExpression;
- } else if (jsxError != null) {
- throw jsxError;
- } else {
- this.raise(
- typeParameters.start,
- "Expected an arrow function after this type parameter declaration",
- );
}
+
+ if (jsx && jsx.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+
+ /*:: invariant(typeParameters) */
+ throw this.raise(
+ typeParameters.start,
+ "Expected an arrow function after this type parameter declaration",
+ );
}
return super.parseMaybeAssign(
@@ -2567,8 +2642,7 @@ export default (superClass: Class): Class =>
// handle return types for arrow functions
parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression {
if (this.match(tt.colon)) {
- const state = this.state.clone();
- try {
+ const result = this.tryParse(() => {
const oldNoAnonFunctionType = this.state.noAnonFunctionType;
this.state.noAnonFunctionType = true;
@@ -2586,18 +2660,18 @@ export default (superClass: Class): Class =>
if (this.canInsertSemicolon()) this.unexpected();
if (!this.match(tt.arrow)) this.unexpected();
- // assign after it is clear it is an arrow
- node.returnType = typeNode.typeAnnotation
- ? this.finishNode(typeNode, "TypeAnnotation")
- : null;
- } catch (err) {
- if (err instanceof SyntaxError) {
- this.state = state;
- } else {
- // istanbul ignore next: no such error is expected
- throw err;
- }
- }
+ return typeNode;
+ });
+
+ if (result.thrown) return null;
+ /*:: invariant(result.node) */
+
+ if (result.error) this.state = result.failState;
+
+ // assign after it is clear it is an arrow
+ node.returnType = result.node.typeAnnotation
+ ? this.finishNode(result.node, "TypeAnnotation")
+ : null;
}
return super.parseArrow(node);
@@ -2630,7 +2704,7 @@ export default (superClass: Class): Class =>
return;
}
- return super.checkParams(node, allowDuplicates, isArrowFunction);
+ return super.checkParams(...arguments);
}
parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {
@@ -2662,23 +2736,33 @@ export default (superClass: Class): Class =>
this.isRelational("<")
) {
const state = this.state.clone();
- let error;
- try {
- const node = this.parseAsyncArrowWithTypeParameters(
- startPos,
- startLoc,
- );
- if (node) return node;
- } catch (e) {
- error = e;
+ const arrow = this.tryParse(
+ abort =>
+ this.parseAsyncArrowWithTypeParameters(startPos, startLoc) ||
+ abort(),
+ state,
+ );
+
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+
+ const result = this.tryParse(
+ () => super.parseSubscripts(base, startPos, startLoc, noCalls),
+ state,
+ );
+
+ if (result.node && !result.error) return result.node;
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
}
- this.state = state;
- try {
- return super.parseSubscripts(base, startPos, startLoc, noCalls);
- } catch (e) {
- throw error || e;
+ if (result.node) {
+ this.state = result.failState;
+ return result.node;
}
+
+ throw arrow.error || result.error;
}
return super.parseSubscripts(base, startPos, startLoc, noCalls);
@@ -2717,8 +2801,8 @@ export default (superClass: Class): Class =>
) {
const node = this.startNodeAt(startPos, startLoc);
node.callee = base;
- const state = this.state.clone();
- try {
+
+ const result = this.tryParse(() => {
node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
this.expect(tt.parenL);
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
@@ -2727,12 +2811,11 @@ export default (superClass: Class): Class =>
node,
subscriptState.optionalChainMember,
);
- } catch (e) {
- if (e instanceof SyntaxError) {
- this.state = state;
- } else {
- throw e;
- }
+ });
+
+ if (result.node) {
+ if (result.error) this.state = result.failState;
+ return result.node;
}
}
@@ -2748,16 +2831,9 @@ export default (superClass: Class): Class =>
parseNewArguments(node: N.NewExpression): void {
let targs = null;
if (this.shouldParseTypes() && this.isRelational("<")) {
- const state = this.state.clone();
- try {
- targs = this.flowParseTypeParameterInstantiationCallOrNew();
- } catch (e) {
- if (e instanceof SyntaxError) {
- this.state = state;
- } else {
- throw e;
- }
- }
+ targs = this.tryParse(() =>
+ this.flowParseTypeParameterInstantiationCallOrNew(),
+ ).node;
}
node.typeArguments = targs;
@@ -2811,7 +2887,7 @@ export default (superClass: Class): Class =>
parseTopLevel(file: N.File, program: N.Program): N.File {
const fileNode = super.parseTopLevel(file, program);
if (this.state.hasFlowComment) {
- this.unexpected(null, "Unterminated flow-comment");
+ this.raise(this.state.pos, "Unterminated flow-comment");
}
return fileNode;
}
@@ -2832,7 +2908,9 @@ export default (superClass: Class): Class =>
if (this.state.hasFlowComment) {
const end = this.input.indexOf("*-/", (this.state.pos += 2));
- if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment");
+ if (end === -1) {
+ throw this.raise(this.state.pos - 2, "Unterminated comment");
+ }
this.state.pos = end + 3;
return;
}
@@ -2874,7 +2952,7 @@ export default (superClass: Class): Class =>
hasFlowCommentCompletion(): void {
const end = this.input.indexOf("*/", this.state.pos);
if (end === -1) {
- this.raise(this.state.pos, "Unterminated comment");
+ throw this.raise(this.state.pos, "Unterminated comment");
}
}
@@ -2931,7 +3009,7 @@ export default (superClass: Class): Class =>
enumName,
suppliedType,
}: { enumName: string, suppliedType: null | string },
- ): void {
+ ) {
const suggestion =
`Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in ` +
`enum \`${enumName}\`.`;
@@ -2939,13 +3017,13 @@ export default (superClass: Class): Class =>
suppliedType === null
? `Supplied enum type is not valid. ${suggestion}`
: `Enum type \`${suppliedType}\` is not valid. ${suggestion}`;
- this.raise(pos, message);
+ return this.raise(pos, message);
}
flowEnumErrorInvalidMemberInitializer(
pos: number,
{ enumName, explicitType, memberName }: EnumContext,
- ): void {
+ ) {
let message = null;
switch (explicitType) {
case "boolean":
@@ -2966,7 +3044,7 @@ export default (superClass: Class): Class =>
`The enum member initializer for \`${memberName}\` needs to be a literal (either ` +
`a boolean, number, or string) in enum \`${enumName}\`.`;
}
- this.raise(pos, message);
+ return this.raise(pos, message);
}
flowEnumErrorNumberMemberNotInitialized(
@@ -3119,8 +3197,7 @@ export default (superClass: Class): Class =>
break;
}
case "invalid": {
- this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
- break;
+ throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
}
case "none": {
switch (explicitType) {
@@ -3184,28 +3261,29 @@ export default (superClass: Class): Class =>
enumName: string,
}): EnumExplicitType {
if (this.eatContextual("of")) {
- if (this.match(tt.name)) {
- switch (this.state.value) {
- case "boolean":
- case "number":
- case "string":
- case "symbol": {
- const explicitType = this.state.value;
- this.next();
- return explicitType;
- }
- default:
- this.flowEnumErrorInvalidExplicitType(this.state.start, {
- enumName,
- suppliedType: this.state.value,
- });
- }
- } else {
- this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ if (!this.match(tt.name)) {
+ throw this.flowEnumErrorInvalidExplicitType(this.state.start, {
enumName,
suppliedType: null,
});
}
+
+ const { value } = this.state;
+ this.next();
+
+ if (
+ value !== "boolean" &&
+ value !== "number" &&
+ value !== "string" &&
+ value !== "symbol"
+ ) {
+ this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: value,
+ });
+ }
+
+ return value;
}
return null;
}
diff --git a/packages/babel-parser/src/plugins/jsx/index.js b/packages/babel-parser/src/plugins/jsx/index.js
index 4daa31ef545d..523702f0dd84 100644
--- a/packages/babel-parser/src/plugins/jsx/index.js
+++ b/packages/babel-parser/src/plugins/jsx/index.js
@@ -82,7 +82,7 @@ export default (superClass: Class): Class =>
let chunkStart = this.state.pos;
for (;;) {
if (this.state.pos >= this.length) {
- this.raise(this.state.start, "Unterminated JSX contents");
+ throw this.raise(this.state.start, "Unterminated JSX contents");
}
const ch = this.input.charCodeAt(this.state.pos);
@@ -142,7 +142,7 @@ export default (superClass: Class): Class =>
let chunkStart = ++this.state.pos;
for (;;) {
if (this.state.pos >= this.length) {
- this.raise(this.state.start, "Unterminated string constant");
+ throw this.raise(this.state.start, "Unterminated string constant");
}
const ch = this.input.charCodeAt(this.state.pos);
@@ -279,13 +279,12 @@ export default (superClass: Class): Class =>
this.next();
node = this.jsxParseExpressionContainer(node);
if (node.expression.type === "JSXEmptyExpression") {
- throw this.raise(
+ this.raise(
node.start,
"JSX attributes must only be assigned a non-empty expression",
);
- } else {
- return node;
}
+ return node;
case tt.jsxTagStart:
case tt.string:
@@ -485,12 +484,18 @@ export default (superClass: Class): Class =>
node.closingElement = closingElement;
}
node.children = children;
- if (this.match(tt.relational) && this.state.value === "<") {
+ while (this.isRelational("<")) {
+ // In case we encounter an lt token here it will always be the start of
+ // jsx as the lt sign is not allowed in places that expect an expression
+ this.finishToken(tt.jsxTagStart);
+
this.raise(
this.state.start,
"Adjacent JSX elements must be wrapped in an enclosing tag. " +
"Did you want a JSX fragment <>...>?",
);
+
+ this.jsxParseElement();
}
return isFragment(openingElement)
diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js
index 4dc707be7cb9..e5d461b55e46 100644
--- a/packages/babel-parser/src/plugins/typescript/index.js
+++ b/packages/babel-parser/src/plugins/typescript/index.js
@@ -1,6 +1,9 @@
// @flow
+/*:: declare var invariant; */
+
import type { TokenType } from "../../tokenizer/types";
+import type State from "../../tokenizer/state";
import { types as tt } from "../../tokenizer/types";
import { types as ct } from "../../tokenizer/context";
import * as N from "../../types";
@@ -234,8 +237,8 @@ export default (superClass: Class): Class =>
this.expect(tt._import);
this.expect(tt.parenL);
if (!this.match(tt.string)) {
- throw this.unexpected(
- null,
+ this.raise(
+ this.state.start,
"Argument in a type import must be a string literal",
);
}
@@ -371,13 +374,13 @@ export default (superClass: Class): Class =>
pattern.type !== "ObjectPattern" &&
pattern.type !== "ArrayPattern"
) {
- throw this.unexpected(
+ this.raise(
pattern.start,
"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," +
`instead got ${pattern.type}`,
);
}
- return pattern;
+ return (pattern: any);
},
);
}
@@ -642,7 +645,7 @@ export default (superClass: Class): Class =>
const node: N.TsLiteralType = this.startNode();
const templateNode = this.parseTemplate(false);
if (templateNode.expressions.length > 0) {
- throw this.raise(
+ this.raise(
templateNode.expressions[0].start,
"Template literal types cannot have any substitution",
);
@@ -1276,17 +1279,12 @@ export default (superClass: Class): Class =>
return res;
}
- tsTryParseAndCatch(f: () => T): ?T {
- const state = this.state.clone();
- try {
- return f();
- } catch (e) {
- if (e instanceof SyntaxError) {
- this.state = state;
- return undefined;
- }
- throw e;
- }
+ tsTryParseAndCatch(f: () => T): ?T {
+ const result = this.tryParse(abort => f() || abort());
+
+ if (result.aborted || !result.node) return undefined;
+ if (result.error) this.state = result.failState;
+ return result.node;
}
tsTryParse(f: () => ?T): ?T {
@@ -1558,12 +1556,12 @@ export default (superClass: Class): Class =>
if (accessibility) pp.accessibility = accessibility;
if (readonly) pp.readonly = readonly;
if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
- throw this.raise(
+ this.raise(
pp.start,
"A parameter property may not be declared using a binding pattern.",
);
}
- pp.parameter = elt;
+ pp.parameter = ((elt: any): N.Identifier | N.AssignmentPattern);
return this.finishNode(pp, "TSParameterProperty");
}
@@ -1597,11 +1595,13 @@ export default (superClass: Class): Class =>
super.parseFunctionBodyAndFinish(node, type, isMethod);
}
- checkFunctionStatementId(node: N.Function): void {
+ registerFunctionStatementId(node: N.Function): void {
if (!node.body && node.id) {
+ // Function ids are validated after parsing their body.
+ // For bodyless function, we need to do it here.
this.checkLVal(node.id, BIND_TS_AMBIENT, null, "function name");
} else {
- super.checkFunctionStatementId(...arguments);
+ super.registerFunctionStatementId(...arguments);
}
}
@@ -1946,19 +1946,17 @@ export default (superClass: Class): Class =>
);
}
- const state = this.state.clone();
- try {
- return super.parseConditional(expr, noIn, startPos, startLoc);
- } catch (err) {
- if (!(err instanceof SyntaxError)) {
- // istanbul ignore next: no such error is expected
- throw err;
- }
+ const result = this.tryParse(() =>
+ super.parseConditional(expr, noIn, startPos, startLoc),
+ );
- this.state = state;
- refNeedsArrowPos.start = err.pos || this.state.start;
+ if (!result.node) {
+ // $FlowIgnore
+ refNeedsArrowPos.start = result.error.pos || this.state.start;
return expr;
}
+ if (result.error) this.state = result.failState;
+ return result.node;
}
// Note: These "type casts" are *not* valid TS expressions.
@@ -2161,80 +2159,97 @@ export default (superClass: Class): Class =>
parseMaybeAssign(...args): N.Expression {
// Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax.
- let jsxError: ?SyntaxError;
+ let state: ?State;
+ let jsx;
+ let typeCast;
if (this.match(tt.jsxTagStart)) {
- const context = this.curContext();
- assert(context === ct.j_oTag);
- // Only time j_oTag is pushed is right after j_expr.
- assert(this.state.context[this.state.context.length - 2] === ct.j_expr);
-
// Prefer to parse JSX if possible. But may be an arrow fn.
- const state = this.state.clone();
- try {
- return super.parseMaybeAssign(...args);
- } catch (err) {
- if (!(err instanceof SyntaxError)) {
- // istanbul ignore next: no such error is expected
- throw err;
- }
+ state = this.state.clone();
+
+ jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ /*:: invariant(!jsx.aborted) */
+
+ if (!jsx.error) return jsx.node;
- this.state = state;
- // Pop the context added by the jsxTagStart.
- assert(this.curContext() === ct.j_oTag);
- this.state.context.pop();
- assert(this.curContext() === ct.j_expr);
- this.state.context.pop();
- jsxError = err;
+ // Remove `tc.j_expr` and `tc.j_oTag` from context added
+ // by parsing `jsxTagStart` to stop the JSX plugin from
+ // messing with the tokens
+ const { context } = this.state;
+ if (context[context.length - 1] === ct.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === ct.j_expr) {
+ context.length -= 1;
}
}
- if (jsxError === undefined && !this.isRelational("<")) {
+ if (!(jsx && jsx.error) && !this.isRelational("<")) {
return super.parseMaybeAssign(...args);
}
// Either way, we're looking at a '<': tt.jsxTagStart or relational.
- let arrowExpression;
let typeParameters: N.TsTypeParameterDeclaration;
- const state = this.state.clone();
- try {
+ state = state || this.state.clone();
+
+ const arrow = this.tryParse(abort => {
// This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.
typeParameters = this.tsParseTypeParameters();
- arrowExpression = super.parseMaybeAssign(...args);
+ const expr = super.parseMaybeAssign(...args);
+
if (
- arrowExpression.type !== "ArrowFunctionExpression" ||
- (arrowExpression.extra && arrowExpression.extra.parenthesized)
+ expr.type !== "ArrowFunctionExpression" ||
+ (expr.extra && expr.extra.parenthesized)
) {
- this.unexpected(); // Go to the catch block (needs a SyntaxError).
- }
- } catch (err) {
- if (!(err instanceof SyntaxError)) {
- // istanbul ignore next: no such error is expected
- throw err;
+ abort();
}
- if (jsxError) {
- throw jsxError;
+ // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code.
+ if (typeParameters && typeParameters.params.length !== 0) {
+ this.resetStartLocationFromNode(expr, typeParameters);
}
+ expr.typeParameters = typeParameters;
+ return expr;
+ }, state);
+
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+ if (!jsx) {
// Try parsing a type cast instead of an arrow function.
// This will never happen outside of JSX.
// (Because in JSX the '<' should be a jsxTagStart and not a relational.
assert(!this.hasPlugin("jsx"));
- // Parsing an arrow function failed, so try a type cast.
- this.state = state;
+
// This will start with a type assertion (via parseMaybeUnary).
// But don't directly call `this.tsParseTypeAssertion` because we want to handle any binary after it.
- return super.parseMaybeAssign(...args);
+ typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ /*:: invariant(!typeCast.aborted) */
+ if (!typeCast.error) return typeCast.node;
+ }
+
+ if (jsx && jsx.node) {
+ /*:: invariant(jsx.failState) */
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrow.node) {
+ /*:: invariant(arrow.failState) */
+ this.state = arrow.failState;
+ return arrow.node;
}
- // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code.
- if (typeParameters && typeParameters.params.length !== 0) {
- this.resetStartLocationFromNode(arrowExpression, typeParameters);
+ if (typeCast && typeCast.node) {
+ /*:: invariant(typeCast.failState) */
+ this.state = typeCast.failState;
+ return typeCast.node;
}
- arrowExpression.typeParameters = typeParameters;
- return arrowExpression;
+
+ if (jsx && jsx.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ if (typeCast && typeCast.thrown) throw typeCast.error;
+
+ throw (jsx && jsx.error) || arrow.error || (typeCast && typeCast.error);
}
// Handle type assertions
@@ -2250,23 +2265,20 @@ export default (superClass: Class): Class =>
if (this.match(tt.colon)) {
// This is different from how the TS parser does it.
// TS uses lookahead. The Babel Parser parses it as a parenthesized expression and converts.
- const state = this.state.clone();
- try {
+
+ const result = this.tryParse(abort => {
const returnType = this.tsParseTypeOrTypePredicateAnnotation(
tt.colon,
);
- if (this.canInsertSemicolon() || !this.match(tt.arrow)) {
- this.state = state;
- return undefined;
- }
- node.returnType = returnType;
- } catch (err) {
- if (err instanceof SyntaxError) {
- this.state = state;
- } else {
- // istanbul ignore next: no such error is expected
- throw err;
- }
+ if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort();
+ return returnType;
+ });
+
+ if (result.aborted) return;
+
+ if (!result.thrown) {
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node;
}
}
@@ -2277,13 +2289,13 @@ export default (superClass: Class): Class =>
parseAssignableListItemTypes(param: N.Pattern) {
if (this.eat(tt.question)) {
if (param.type !== "Identifier") {
- throw this.raise(
+ this.raise(
param.start,
"A binding pattern parameter cannot be optional in an implementation signature.",
);
}
- param.optional = true;
+ ((param: any): N.Identifier).optional = true;
}
const type = this.tsTryParseTypeAnnotation();
if (type) param.typeAnnotation = type;
diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js
index ab0dbe5b9237..32c8a03fc0b9 100644
--- a/packages/babel-parser/src/tokenizer/index.js
+++ b/packages/babel-parser/src/tokenizer/index.js
@@ -126,8 +126,11 @@ export default class Tokenizer extends LocationParser {
// Move to the next token
next(): void {
- if (this.options.tokens && !this.isLookahead) {
- this.state.tokens.push(new Token(this.state));
+ if (!this.isLookahead) {
+ this.checkKeywordEscapes();
+ if (this.options.tokens) {
+ this.state.tokens.push(new Token(this.state));
+ }
}
this.state.lastTokEnd = this.state.end;
@@ -248,7 +251,7 @@ export default class Tokenizer extends LocationParser {
const startLoc = this.state.curPosition();
const start = this.state.pos;
const end = this.input.indexOf("*/", this.state.pos + 2);
- if (end === -1) this.raise(start, "Unterminated comment");
+ if (end === -1) throw this.raise(start, "Unterminated comment");
this.state.pos = end + 2;
lineBreakG.lastIndex = start;
@@ -384,7 +387,7 @@ export default class Tokenizer extends LocationParser {
const nextPos = this.state.pos + 1;
const next = this.input.charCodeAt(nextPos);
if (next >= charCodes.digit0 && next <= charCodes.digit9) {
- this.raise(this.state.pos, "Unexpected digit after hash token");
+ throw this.raise(this.state.pos, "Unexpected digit after hash token");
}
if (
@@ -400,7 +403,7 @@ export default class Tokenizer extends LocationParser {
) {
this.finishOp(tt.hash, 1);
} else {
- this.raise(this.state.pos, "Unexpected character '#'");
+ throw this.raise(this.state.pos, "Unexpected character '#'");
}
}
@@ -808,7 +811,7 @@ export default class Tokenizer extends LocationParser {
}
}
- this.raise(
+ throw this.raise(
this.state.pos,
`Unexpected character '${String.fromCodePoint(code)}'`,
);
@@ -825,11 +828,11 @@ export default class Tokenizer extends LocationParser {
let escaped, inClass;
for (;;) {
if (this.state.pos >= this.length) {
- this.raise(start, "Unterminated regular expression");
+ throw this.raise(start, "Unterminated regular expression");
}
const ch = this.input.charAt(this.state.pos);
if (lineBreak.test(ch)) {
- this.raise(start, "Unterminated regular expression");
+ throw this.raise(start, "Unterminated regular expression");
}
if (escaped) {
escaped = false;
@@ -858,9 +861,6 @@ export default class Tokenizer extends LocationParser {
if (mods.indexOf(char) > -1) {
this.raise(this.state.pos + 1, "Duplicate regular expression flag");
}
-
- ++this.state.pos;
- mods += char;
} else if (
isIdentifierChar(charCode) ||
charCode === charCodes.backslash
@@ -869,6 +869,9 @@ export default class Tokenizer extends LocationParser {
} else {
break;
}
+
+ ++this.state.pos;
+ mods += char;
}
this.finishToken(tt.regexp, {
@@ -880,10 +883,16 @@ export default class Tokenizer extends LocationParser {
// Read an integer in the given radix. Return null if zero digits
// were read, the integer value otherwise. When `len` is given, this
// will return `null` unless the integer has exactly `len` digits.
+ // When `forceLen` is `true`, it means that we already know that in case
+ // of a malformed number we have to skip `len` characters anyway, instead
+ // of bailing out early. For example, in "\u{123Z}" we want to read up to }
+ // anyway, while in "\u00Z" we will stop at Z instead of consuming four
+ // characters (and thus the closing quote).
readInt(
radix: number,
len?: number,
+ forceLen?: boolean,
allowNumSeparator: boolean = true,
): number | null {
const start = this.state.pos;
@@ -900,6 +909,7 @@ export default class Tokenizer extends LocationParser {
? allowedNumericSeparatorSiblings.oct
: allowedNumericSeparatorSiblings.bin;
+ let invalid = false;
let total = 0;
for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
@@ -911,15 +921,19 @@ export default class Tokenizer extends LocationParser {
const prev = this.input.charCodeAt(this.state.pos - 1);
const next = this.input.charCodeAt(this.state.pos + 1);
if (allowedSiblings.indexOf(next) === -1) {
- this.raise(this.state.pos, "Invalid or unexpected token");
- }
-
- if (
+ this.raise(
+ this.state.pos,
+ "A numeric separator is only allowed between two digits",
+ );
+ } else if (
forbiddenSiblings.indexOf(prev) > -1 ||
forbiddenSiblings.indexOf(next) > -1 ||
Number.isNaN(next)
) {
- this.raise(this.state.pos, "Invalid or unexpected token");
+ this.raise(
+ this.state.pos,
+ "A numeric separator is only allowed between two digits",
+ );
}
if (!allowNumSeparator) {
@@ -944,13 +958,30 @@ export default class Tokenizer extends LocationParser {
} else {
val = Infinity;
}
- if (val >= radix) break;
+ if (val >= radix) {
+ // If we are in "errorRecovery" mode and we found a digit which is too big,
+ // don't break the loop.
+
+ if (this.options.errorRecovery && val <= 9) {
+ val = 0;
+ this.raise(
+ this.state.start + i + 2,
+ "Expected number in radix " + radix,
+ );
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
++this.state.pos;
total = total * radix + val;
}
if (
this.state.pos === start ||
- (len != null && this.state.pos - start !== len)
+ (len != null && this.state.pos - start !== len) ||
+ invalid
) {
return null;
}
@@ -976,7 +1007,7 @@ export default class Tokenizer extends LocationParser {
}
if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
- this.raise(this.state.pos, "Identifier directly after number");
+ throw this.raise(this.state.pos, "Identifier directly after number");
}
if (isBigInt) {
@@ -1062,7 +1093,7 @@ export default class Tokenizer extends LocationParser {
}
if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
- this.raise(this.state.pos, "Identifier directly after number");
+ throw this.raise(this.state.pos, "Identifier directly after number");
}
// remove "_" for numeric literal separator, and "n" for BigInts
@@ -1087,6 +1118,7 @@ export default class Tokenizer extends LocationParser {
const codePos = ++this.state.pos;
code = this.readHexChar(
this.input.indexOf("}", this.state.pos) - this.state.pos,
+ true,
throwOnInvalid,
);
++this.state.pos;
@@ -1102,7 +1134,7 @@ export default class Tokenizer extends LocationParser {
}
}
} else {
- code = this.readHexChar(4, throwOnInvalid);
+ code = this.readHexChar(4, false, throwOnInvalid);
}
return code;
}
@@ -1112,7 +1144,7 @@ export default class Tokenizer extends LocationParser {
chunkStart = ++this.state.pos;
for (;;) {
if (this.state.pos >= this.length) {
- this.raise(this.state.start, "Unterminated string constant");
+ throw this.raise(this.state.start, "Unterminated string constant");
}
const ch = this.input.charCodeAt(this.state.pos);
if (ch === quote) break;
@@ -1128,7 +1160,7 @@ export default class Tokenizer extends LocationParser {
++this.state.pos;
++this.state.curLine;
} else if (isNewLine(ch)) {
- this.raise(this.state.start, "Unterminated string constant");
+ throw this.raise(this.state.start, "Unterminated string constant");
} else {
++this.state.pos;
}
@@ -1145,7 +1177,7 @@ export default class Tokenizer extends LocationParser {
containsInvalid = false;
for (;;) {
if (this.state.pos >= this.length) {
- this.raise(this.state.start, "Unterminated template");
+ throw this.raise(this.state.start, "Unterminated template");
}
const ch = this.input.charCodeAt(this.state.pos);
if (
@@ -1214,7 +1246,7 @@ export default class Tokenizer extends LocationParser {
case charCodes.lowercaseR:
return "\r";
case charCodes.lowercaseX: {
- const code = this.readHexChar(2, throwOnInvalid);
+ const code = this.readHexChar(2, false, throwOnInvalid);
return code === null ? null : String.fromCharCode(code);
}
case charCodes.lowercaseU: {
@@ -1288,9 +1320,13 @@ export default class Tokenizer extends LocationParser {
// Used to read character escape sequences ('\x', '\u').
- readHexChar(len: number, throwOnInvalid: boolean): number | null {
+ readHexChar(
+ len: number,
+ forceLen: boolean,
+ throwOnInvalid: boolean,
+ ): number | null {
const codePos = this.state.pos;
- const n = this.readInt(16, len, false);
+ const n = this.readInt(16, len, forceLen, false);
if (n === null) {
if (throwOnInvalid) {
this.raise(codePos, "Bad character escape sequence");
@@ -1333,20 +1369,18 @@ export default class Tokenizer extends LocationParser {
this.state.pos,
"Expecting Unicode escape sequence \\uXXXX",
);
+ continue;
}
++this.state.pos;
const esc = this.readCodePoint(true);
+ if (esc !== null) {
+ if (!identifierCheck(esc)) {
+ this.raise(escStart, "Invalid Unicode escape");
+ }
- if (
- // $FlowFixMe (thinks esc may be null, but throwOnInvalid is true)
- !identifierCheck(esc, true)
- ) {
- this.raise(escStart, "Invalid Unicode escape");
+ word += String.fromCodePoint(esc);
}
-
- // $FlowFixMe
- word += String.fromCodePoint(esc);
chunkStart = this.state.pos;
} else {
break;
@@ -1364,7 +1398,7 @@ export default class Tokenizer extends LocationParser {
readWord(): void {
const word = this.readWord1();
- const type = (!this.state.containsEsc && keywordTypes.get(word)) || tt.name;
+ const type = keywordTypes.get(word) || tt.name;
// Allow @@iterator and @@asyncIterator as a identifier only inside type
if (
@@ -1377,6 +1411,13 @@ export default class Tokenizer extends LocationParser {
this.finishToken(type, word);
}
+ checkKeywordEscapes(): void {
+ const kw = this.state.type.keyword;
+ if (kw && this.state.containsEsc) {
+ this.raise(this.state.start, `Escape sequence in keyword ${kw}`);
+ }
+ }
+
braceIsBlock(prevType: TokenType): boolean {
const parent = this.curContext();
if (parent === ct.functionExpression || parent === ct.functionStatement) {
diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js
index 4ee937e1d292..6ff711f373c6 100644
--- a/packages/babel-parser/src/tokenizer/state.js
+++ b/packages/babel-parser/src/tokenizer/state.js
@@ -38,6 +38,8 @@ export default class State {
this.startLoc = this.endLoc = this.curPosition();
}
+ errors: SyntaxError[] = [];
+
// Used to signify the start of a potential arrow function
potentialArrowAt: number = -1;
diff --git a/packages/babel-parser/src/util/identifier.js b/packages/babel-parser/src/util/identifier.js
index 7fda0e27de71..cbcc59cb6f81 100644
--- a/packages/babel-parser/src/util/identifier.js
+++ b/packages/babel-parser/src/util/identifier.js
@@ -21,9 +21,7 @@ const reservedWords = {
};
const reservedWordsStrictSet = new Set(reservedWords.strict);
-const reservedWordsStrictBindSet = new Set(
- reservedWords.strict.concat(reservedWords.strictBind),
-);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
/**
* Checks if word is a reserved word in non-strict mode
@@ -41,6 +39,14 @@ export function isStrictReservedWord(word: string, inModule: boolean): boolean {
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
}
+/**
+ * Checks if word is a reserved word in binding strict mode, but it is allowed as
+ * a normal identifier.
+ */
+export function isStrictBindOnlyReservedWord(word: string): boolean {
+ return reservedWordsStrictBindSet.has(word);
+}
+
/**
* Checks if word is a reserved word in binding strict mode
*
@@ -50,7 +56,9 @@ export function isStrictBindReservedWord(
word: string,
inModule: boolean,
): boolean {
- return isReservedWord(word, inModule) || reservedWordsStrictBindSet.has(word);
+ return (
+ isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)
+ );
}
export function isKeyword(word: string): boolean {
diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/options.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json
new file mode 100644
index 000000000000..bed17cab3909
--- /dev/null
+++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json
@@ -0,0 +1,128 @@
+{
+ "type": "FunctionExpression",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 10,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "right": {
+ "type": "StringLiteral",
+ "start": 14,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "extra": {
+ "rawValue": "default",
+ "raw": "\"default\""
+ },
+ "value": "default"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 25,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 26,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 26,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/options.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/options.json
index 5f24fc4399ed..4f434cf0aa86 100644
--- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/options.json
+++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/options.json
@@ -1,4 +1,3 @@
{
- "strictMode": true,
- "throws": "Unexpected reserved word 'public' (2:0)"
-}
+ "strictMode": true
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json
new file mode 100644
index 000000000000..df12702dd8b4
--- /dev/null
+++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json
@@ -0,0 +1,20 @@
+{
+ "type": "Identifier",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "public"
+ },
+ "name": "public",
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'public' (2:0)"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/options.json
deleted file mode 100644
index 05a7826ae8ba..000000000000
--- a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json
new file mode 100644
index 000000000000..7ad34b6ae910
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json
@@ -0,0 +1,125 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "WhileStatement",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "test": {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "body": {
+ "type": "FunctionDeclaration",
+ "start": 10,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/options.json
deleted file mode 100644
index 395620bfa2f8..000000000000
--- a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json
new file mode 100644
index 000000000000..64064c04c2b9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "WhileStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "test": {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "body": {
+ "type": "LabeledStatement",
+ "start": 10,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": {
+ "type": "LabeledStatement",
+ "start": 15,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": {
+ "type": "FunctionDeclaration",
+ "start": 20,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json
deleted file mode 100644
index 3ef90d2032d2..000000000000
--- a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'break' (2:2)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json
new file mode 100644
index 000000000000..742ca4b45728
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'break' (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 8,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 12,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "break"
+ },
+ "name": "break"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "break"
+ },
+ "name": "break"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json
deleted file mode 100644
index 3ae5cb6c96c4..000000000000
--- a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json
new file mode 100644
index 000000000000..20b84ecf03fa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "value": {
+ "raw": "\\8",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json
deleted file mode 100644
index 3ae5cb6c96c4..000000000000
--- a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json
new file mode 100644
index 000000000000..9e0985f69a92
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "value": {
+ "raw": "\\9",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/options.json b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/options.json
index 8ac5b45f7194..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/options.json
+++ b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Legacy octal literals are not allowed in strict mode (1:0)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json
new file mode 100644
index 000000000000..99253558c815
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 9.5,
+ "raw": "09.5"
+ },
+ "value": 9.5
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/options.json
deleted file mode 100644
index b14806508f97..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (4:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json
new file mode 100644
index 000000000000..f017f0fa5f00
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json
@@ -0,0 +1,247 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (4:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 4,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 19,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 30,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 34,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/options.json
deleted file mode 100644
index 6a0c16d56696..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (3:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json
new file mode 100644
index 000000000000..758528386efb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json
@@ -0,0 +1,229 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (3:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 9,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 22,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 26,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/options.json
deleted file mode 100644
index b14806508f97..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (4:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json
new file mode 100644
index 000000000000..0444f665d33d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json
@@ -0,0 +1,247 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (4:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 4,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 19,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 30,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 34,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/options.json
deleted file mode 100644
index 6a0c16d56696..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (3:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json
new file mode 100644
index 000000000000..76f48823dd81
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json
@@ -0,0 +1,229 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (3:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 9,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 22,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 26,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/options.json
deleted file mode 100644
index 2cbe06c40914..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json
new file mode 100644
index 000000000000..899412645531
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 8,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "param": {
+ "type": "ArrayPattern",
+ "start": 15,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ {
+ "type": "Identifier",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ ]
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/options.json
deleted file mode 100644
index ac735b2ace22..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (1:35)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json
new file mode 100644
index 000000000000..cddf0493cba9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json
@@ -0,0 +1,222 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (1:35)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "TryStatement",
+ "start": 9,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 16,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 28,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 31,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/options.json
deleted file mode 100644
index 6f5b5641a148..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (3:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json
new file mode 100644
index 000000000000..ab1db27cf0a8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json
@@ -0,0 +1,173 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (3:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 8,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 24,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 39,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/options.json
deleted file mode 100644
index 254a763e653e..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (3:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json
new file mode 100644
index 000000000000..e759f28d0434
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (3:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 8,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 24,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 28,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/options.json
deleted file mode 100644
index bf345ea77127..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:28)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json
new file mode 100644
index 000000000000..5a4c9d365dbe
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json
@@ -0,0 +1,293 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:28)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 8,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "param": {
+ "type": "ObjectPattern",
+ "start": 15,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 17,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 25,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ObjectPattern",
+ "start": 28,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 30,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 33,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 34,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/options.json
deleted file mode 100644
index 254a763e653e..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (3:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json
new file mode 100644
index 000000000000..40bb3df74915
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (3:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 8,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "param": {
+ "type": "ArrayPattern",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ ]
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 26,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 30,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/options.json
deleted file mode 100644
index 254a763e653e..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (3:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json
new file mode 100644
index 000000000000..5cd4c6abd102
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json
@@ -0,0 +1,227 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (3:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 8,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "param": {
+ "type": "ObjectPattern",
+ "start": 15,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 24,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 28,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/options.json
deleted file mode 100644
index cdd0ac832c57..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json
new file mode 100644
index 000000000000..6d2e82b586ae
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "ClassDeclaration",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/options.json
deleted file mode 100644
index cdd0ac832c57..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json
new file mode 100644
index 000000000000..a23d95cfc217
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 20,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/options.json
deleted file mode 100644
index a3504d289fd7..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json
new file mode 100644
index 000000000000..a6bf56aa7623
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json
@@ -0,0 +1,169 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 30,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/options.json
deleted file mode 100644
index c04a6f3e48eb..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json
new file mode 100644
index 000000000000..49daeec3aef6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 18,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/options.json
deleted file mode 100644
index c04a6f3e48eb..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json
new file mode 100644
index 000000000000..205470069b5d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json
@@ -0,0 +1,153 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/options.json
deleted file mode 100644
index d62aabfd1b07..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json
new file mode 100644
index 000000000000..b6f764fce7a5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/options.json
deleted file mode 100644
index 1b6192a1bc04..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'f' has already been declared (1:28)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json
new file mode 100644
index 000000000000..ebd20401ed0f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'f' has already been declared (1:28)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 2,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 18,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/options.json
index 3f4250fbe917..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Identifier 'foo' has already been declared (1:29)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json
new file mode 100644
index 000000000000..c1b2c1a85a29
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (1:29)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 2,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 20,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 35,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/options.json
index e253f0a85f47..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Identifier 'foo' has already been declared (2:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json
new file mode 100644
index 000000000000..eadbdeeb68f8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json
@@ -0,0 +1,142 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 18,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/options.json
deleted file mode 100644
index 254a763e653e..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (3:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json
new file mode 100644
index 000000000000..454a440c3426
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (3:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 4,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 24,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 28,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/options.json
deleted file mode 100644
index 1b6192a1bc04..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'f' has already been declared (1:28)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json
new file mode 100644
index 000000000000..fdad445b5deb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'f' has already been declared (1:28)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 2,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 19,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/options.json
deleted file mode 100644
index 8ca49120a98a..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json
new file mode 100644
index 000000000000..e28bf9f399b0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": null
+ },
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/options.json
deleted file mode 100644
index 3eaa378d43e7..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'a' has already been declared (3:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json
new file mode 100644
index 000000000000..f925321aef98
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'a' has already been declared (3:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 4,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/for-var/options.json b/packages/babel-parser/test/fixtures/core/scope/for-var/options.json
deleted file mode 100644
index 5f2332a9ed8f..000000000000
--- a/packages/babel-parser/test/fixtures/core/scope/for-var/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'i' has already been declared (2:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/scope/for-var/output.json b/packages/babel-parser/test/fixtures/core/scope/for-var/output.json
new file mode 100644
index 000000000000..bfd483ec7fb4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/for-var/output.json
@@ -0,0 +1,194 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'i' has already been declared (2:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForStatement",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "init": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ "test": null,
+ "update": null,
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 24,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json
index 8448889cf253..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Export 'encrypt' is not defined (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json
new file mode 100644
index 000000000000..996bc32d815d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Export 'encrypt' is not defined (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json
index 8448889cf253..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Export 'encrypt' is not defined (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json
new file mode 100644
index 000000000000..11a778f34809
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json
@@ -0,0 +1,158 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Export 'encrypt' is not defined (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ },
+ "identifierName": "decrypt"
+ },
+ "name": "decrypt"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 31,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 40,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "decrypt"
+ },
+ "name": "decrypt"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 50,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json
index 0844d3e80e68..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Export 'encrypt' is not defined (4:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json
new file mode 100644
index 000000000000..a660653865e5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Export 'encrypt' is not defined (4:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 4,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 28,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json
index cbab70613300..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Export 'Object' is not defined (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json
new file mode 100644
index 000000000000..ce100047f2fe
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Export 'Object' is not defined (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "Object"
+ },
+ "name": "Object"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "Obj"
+ },
+ "name": "Obj"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json
index cbab70613300..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Export 'Object' is not defined (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json
new file mode 100644
index 000000000000..22aa25d45da7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Export 'Object' is not defined (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "Object"
+ },
+ "name": "Object"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "Object"
+ },
+ "name": "Object"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json
index 2c97b3ce5a78..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "In strict mode code, functions can only be declared at top level or inside a block (2:10)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json
new file mode 100644
index 000000000000..dbff016172cc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json
@@ -0,0 +1,191 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "errors": [
+ "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block (2:10)",
+ "SyntaxError: Export 'encrypt' is not defined (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ },
+ {
+ "type": "IfStatement",
+ "start": 20,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 24,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": true
+ },
+ "consequent": {
+ "type": "FunctionDeclaration",
+ "start": 30,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 49,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "alternate": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json
index 8448889cf253..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Export 'encrypt' is not defined (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json
new file mode 100644
index 000000000000..6293e83f540f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Export 'encrypt' is not defined (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "encrypt"
+ },
+ "name": "encrypt"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/108/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/108/options.json
deleted file mode 100644
index 080cb0eaaa8a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/108/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid regular expression flag (1:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json
new file mode 100644
index 000000000000..65ac2b95f145
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json
@@ -0,0 +1,112 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid regular expression flag (1:17)",
+ "SyntaxError: Invalid regular expression flag (1:19)",
+ "SyntaxError: Invalid regular expression flag (1:20)",
+ "SyntaxError: Invalid regular expression flag (1:21)",
+ "SyntaxError: Invalid regular expression flag (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "RegExpLiteral",
+ "start": 8,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "extra": {
+ "raw": "/[P QR]/\\u0067"
+ },
+ "pattern": "[P QR]",
+ "flags": "\\u0067"
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/347/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/347/options.json
index 91bb1eef0c0d..aa61ff56c2b3 100644
--- a/packages/babel-parser/test/fixtures/core/uncategorised/347/options.json
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/347/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Invalid number (1:0)"
-}
+ "throws": "Identifier directly after number (1:2)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/349/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/349/options.json
deleted file mode 100644
index 91bb1eef0c0d..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/349/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid number (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json
new file mode 100644
index 000000000000..284fac8c4357
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid number (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3e"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/350/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/350/options.json
deleted file mode 100644
index 91bb1eef0c0d..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/350/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid number (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json
new file mode 100644
index 000000000000..6b6e666b00ca
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid number (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3e+"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/351/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/351/options.json
deleted file mode 100644
index 91bb1eef0c0d..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/351/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid number (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json
new file mode 100644
index 000000000000..b52b27d1ef37
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid number (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3e-"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/354/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/354/options.json
deleted file mode 100644
index 1a0693338eee..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/354/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 16 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json
new file mode 100644
index 000000000000..ffcb3680fd0b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 16 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0x"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/361/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/361/options.json
deleted file mode 100644
index 18c53b997b56..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/361/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json
new file mode 100644
index 000000000000..fbb1d3b5d554
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "xx\\"
+ },
+ "name": "xx\\"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/362/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/362/options.json
deleted file mode 100644
index ea7ba01dc69c..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/362/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json
new file mode 100644
index 000000000000..fae32b78cde4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "x\\"
+ },
+ "name": "x\\"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/363/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/363/options.json
deleted file mode 100644
index ea7ba01dc69c..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/363/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json
new file mode 100644
index 000000000000..37312f42ce97
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "x*"
+ },
+ "name": "x*"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/366/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/366/options.json
deleted file mode 100644
index adf556b0a352..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/366/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid regular expression flag (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json
new file mode 100644
index 000000000000..68d637a98170
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json
@@ -0,0 +1,109 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid regular expression flag (1:16)",
+ "SyntaxError: Invalid regular expression flag (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "RegExpLiteral",
+ "start": 8,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "extra": {
+ "raw": "/[a-z]/\\ux"
+ },
+ "pattern": "[a-z]",
+ "flags": "\\ux"
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/367/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/367/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/367/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json
new file mode 100644
index 000000000000..99a3e74a04af
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json
@@ -0,0 +1,109 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3"
+ },
+ "value": 3
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 4,
+ "raw": "4"
+ },
+ "value": 4
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/368/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/368/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/368/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json
new file mode 100644
index 000000000000..8770df4abba7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "func"
+ },
+ "name": "func"
+ },
+ "arguments": []
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 4,
+ "raw": "4"
+ },
+ "value": 4
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/369/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/369/options.json
deleted file mode 100644
index 7c5f08eb9ba6..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/369/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json
new file mode 100644
index 000000000000..42614106f157
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json
@@ -0,0 +1,149 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "BinaryExpression",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "left": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/370/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/370/options.json
deleted file mode 100644
index c09dac1301de..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/370/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in postfix operation (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json
new file mode 100644
index 000000000000..ce2cb3d23d67
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in postfix operation (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "++",
+ "prefix": false,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/371/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/371/options.json
deleted file mode 100644
index c09dac1301de..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/371/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in postfix operation (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json
new file mode 100644
index 000000000000..57d55fec0b5d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in postfix operation (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "--",
+ "prefix": false,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/372/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/372/options.json
deleted file mode 100644
index 515e441e8ea7..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/372/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in prefix operation (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json
new file mode 100644
index 000000000000..9a7a240c5b4a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in prefix operation (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "++",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/373/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/373/options.json
deleted file mode 100644
index 515e441e8ea7..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/373/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in prefix operation (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json
new file mode 100644
index 000000000000..85107220dae5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in prefix operation (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "--",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/374/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/374/options.json
deleted file mode 100644
index f8560a7de9d6..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/374/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-in statement (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json
new file mode 100644
index 000000000000..f9e5df01e76a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json
@@ -0,0 +1,196 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-in statement (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "left": {
+ "type": "BinaryExpression",
+ "start": 5,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "left": {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 4
+ }
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "list"
+ },
+ "name": "list"
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 21,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 21,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ },
+ "identifierName": "process"
+ },
+ "name": "process"
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "start": 29,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/382/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/382/options.json
deleted file mode 100644
index 2b91be8d5115..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/382/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'if' (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json
new file mode 100644
index 000000000000..ac910291b748
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'if' (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "if"
+ },
+ "name": "if"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/383/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/383/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/383/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json
new file mode 100644
index 000000000000..56547ff7be13
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json
@@ -0,0 +1,142 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/384/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/384/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/384/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json
new file mode 100644
index 000000000000..ece139488ea0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json
@@ -0,0 +1,123 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "UnaryExpression",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "operator": "+",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ }
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/397/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/397/options.json
deleted file mode 100644
index f9543317a817..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/397/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'if' (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json
new file mode 100644
index 000000000000..0e5a7503ecdd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'if' (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "if"
+ },
+ "name": "if"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/398/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/398/options.json
deleted file mode 100644
index bba7a057d842..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/398/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'true' (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json
new file mode 100644
index 000000000000..9da054e4ab90
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'true' (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "true"
+ },
+ "name": "true"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/399/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/399/options.json
deleted file mode 100644
index b04b18396af1..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/399/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'false' (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json
new file mode 100644
index 000000000000..f4f5b906e9c7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'false' (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "false"
+ },
+ "name": "false"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/400/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/400/options.json
deleted file mode 100644
index 667f2cc8816d..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/400/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'null' (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json
new file mode 100644
index 000000000000..b8eaca925ad4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'null' (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "null"
+ },
+ "name": "null"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/401/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/401/options.json
deleted file mode 100644
index fa57d4f43f70..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/401/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'null' (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json
new file mode 100644
index 000000000000..3fea78461b66
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'null' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "null"
+ },
+ "name": "null"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/402/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/402/options.json
deleted file mode 100644
index c4a7ead13704..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/402/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'true' (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json
new file mode 100644
index 000000000000..fc0c10f2f765
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'true' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "true"
+ },
+ "name": "true"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/403/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/403/options.json
deleted file mode 100644
index 0e9cf8962aae..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/403/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'false' (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json
new file mode 100644
index 000000000000..7e708faf3684
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'false' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "false"
+ },
+ "name": "false"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/404/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/404/options.json
deleted file mode 100644
index a87aa98c0e01..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/404/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'if' (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json
new file mode 100644
index 000000000000..813c4e9b903a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'if' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "if"
+ },
+ "name": "if"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/409/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/409/options.json
deleted file mode 100644
index 701f9fe8f27a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/409/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json
new file mode 100644
index 000000000000..d3a105c584dd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/411/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/411/options.json
deleted file mode 100644
index de66853a7a3d..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/411/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json
new file mode 100644
index 000000000000..c32c5b089115
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/417/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/417/options.json
deleted file mode 100644
index f8560a7de9d6..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/417/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-in statement (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json
new file mode 100644
index 000000000000..3844a4d151a7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-in statement (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "left": {
+ "type": "BinaryExpression",
+ "start": 5,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/418/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/418/options.json
deleted file mode 100644
index f8560a7de9d6..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/418/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-in statement (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json
new file mode 100644
index 000000000000..9d008175f644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json
@@ -0,0 +1,118 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-in statement (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "operator": "+",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ }
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/425/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/425/options.json
deleted file mode 100644
index 429d96ca3f9a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/425/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Missing catch or finally clause (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json
new file mode 100644
index 000000000000..3d2ee0555b85
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json
@@ -0,0 +1,72 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Missing catch or finally clause (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": null,
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/427/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/427/options.json
deleted file mode 100644
index aadfa63716c2..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/427/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Multiple default clauses (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json
new file mode 100644
index 000000000000..c90c4eefdc6f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Multiple default clauses (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "SwitchStatement",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "discriminant": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ },
+ "cases": [
+ {
+ "type": "SwitchCase",
+ "start": 13,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "consequent": [],
+ "test": null
+ },
+ {
+ "type": "SwitchCase",
+ "start": 22,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "consequent": [],
+ "test": null
+ }
+ ]
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/446/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/446/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/446/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json
new file mode 100644
index 000000000000..1db488318bdf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json
@@ -0,0 +1,71 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)",
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "\\\\\\"
+ },
+ "name": "\\\\\\"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/447/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/447/options.json
deleted file mode 100644
index 82bcfe621c49..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/447/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json
new file mode 100644
index 000000000000..d44909ca998a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "\\"
+ },
+ "name": "\\"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/448/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/448/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/448/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json
new file mode 100644
index 000000000000..38cc0c05b021
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "\\x"
+ },
+ "name": "\\x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/449/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/449/options.json
deleted file mode 100644
index 82bcfe621c49..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/449/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json
new file mode 100644
index 000000000000..380e6ec698ef
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "\u0000"
+ },
+ "name": "\u0000"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/453/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/453/options.json
index 8e0dce66eff8..a760565b1bd2 100644
--- a/packages/babel-parser/test/fixtures/core/uncategorised/453/options.json
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/453/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Bad character escape sequence (1:3)"
-}
+ "throws": "Unterminated string constant (1:0)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/454/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/454/options.json
deleted file mode 100644
index f9d29c7f328c..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/454/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'return' outside of function (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json
new file mode 100644
index 000000000000..e43da2374537
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: 'return' outside of function (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "argument": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/455/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/455/options.json
deleted file mode 100644
index 701f9fe8f27a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/455/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json
new file mode 100644
index 000000000000..d3a105c584dd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/456/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/456/options.json
deleted file mode 100644
index de66853a7a3d..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/456/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json
new file mode 100644
index 000000000000..c32c5b089115
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/457/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/457/options.json
deleted file mode 100644
index c726e8fa98e4..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/457/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json
new file mode 100644
index 000000000000..b83145faf5ab
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "SwitchStatement",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "discriminant": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "cases": [
+ {
+ "type": "SwitchCase",
+ "start": 13,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "consequent": [
+ {
+ "type": "ContinueStatement",
+ "start": 22,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "label": null
+ }
+ ],
+ "test": null
+ }
+ ]
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/459/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/459/options.json
deleted file mode 100644
index 070e662e80d4..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/459/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json
new file mode 100644
index 000000000000..a7c8d4f9a0ca
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "WhileStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 15,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/460/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/460/options.json
deleted file mode 100644
index 2a2e15787aa7..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/460/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json
new file mode 100644
index 000000000000..2f1c8737b22e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "WhileStatement",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 15,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/461/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/461/options.json
deleted file mode 100644
index 464af80a1561..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/461/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json
new file mode 100644
index 000000000000..7337acd3e8fd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json
@@ -0,0 +1,207 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 19,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 33,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 18
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/462/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/462/options.json
deleted file mode 100644
index a056cb50e190..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/462/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json
new file mode 100644
index 000000000000..18bc9b977ca7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json
@@ -0,0 +1,207 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 19,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 18
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/463/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/463/options.json
deleted file mode 100644
index 464af80a1561..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/463/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json
new file mode 100644
index 000000000000..59ae007d6fba
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json
@@ -0,0 +1,191 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 19,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 33,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 18
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/464/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/464/options.json
deleted file mode 100644
index a056cb50e190..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/464/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json
new file mode 100644
index 000000000000..d26e37b08031
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json
@@ -0,0 +1,191 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 19,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 33,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 18
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/465/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/465/options.json
deleted file mode 100644
index da7f2590db0b..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/465/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Label 'x' is already declared (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json
new file mode 100644
index 000000000000..3025d6bfbf72
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json
@@ -0,0 +1,199 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Label 'x' is already declared (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 18,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 21,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 28,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/466/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/466/options.json
deleted file mode 100644
index 1517e1719333..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/466/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Deleting local variable in strict mode (1:29)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json
new file mode 100644
index 000000000000..f22f0efb0609
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "errors": [
+ "SyntaxError: Deleting local variable in strict mode (1:29)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 1,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "UnaryExpression",
+ "start": 29,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "operator": "delete",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/467/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/467/options.json
deleted file mode 100644
index 31b4c6d2a040..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/467/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'with' in strict mode (1:29)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json
new file mode 100644
index 000000000000..1567b18881d6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json
@@ -0,0 +1,193 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "errors": [
+ "SyntaxError: 'with' in strict mode (1:29)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 1,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [
+ {
+ "type": "WithStatement",
+ "start": 29,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/468/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/468/options.json
deleted file mode 100644
index dfbf1f6d0d1c..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/468/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json
new file mode 100644
index 000000000000..7598b7431e9f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:36)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 32,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 36,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 43,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 43
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/469/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/469/options.json
deleted file mode 100644
index b74dfcf59199..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/469/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json
new file mode 100644
index 000000000000..7101109189a2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:36)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 32,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 36,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 48,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/470/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/470/options.json
deleted file mode 100644
index e95a2d7f7535..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/470/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:47)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json
new file mode 100644
index 000000000000..dd5fca85f2e5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:47)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 32,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 40,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 53,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/471/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/471/options.json
deleted file mode 100644
index 14d96617b4b6..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/471/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:47)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json
new file mode 100644
index 000000000000..3b89f63424e2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:47)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 32,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 40,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 58,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 58
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/472/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/472/options.json
deleted file mode 100644
index 6faa5d0476c3..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/472/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json
new file mode 100644
index 000000000000..2973f3517639
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 32,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 39,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/473/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/473/options.json
deleted file mode 100644
index 2f502104f7d4..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/473/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json
new file mode 100644
index 000000000000..e328a1e98ef9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 32,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 44,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 44
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/474/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/474/options.json
deleted file mode 100644
index 0964911894d9..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/474/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:34)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json
new file mode 100644
index 000000000000..95091e65367d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:34)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "++",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/475/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/475/options.json
deleted file mode 100644
index 0964911894d9..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/475/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:34)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json
new file mode 100644
index 000000000000..8473055a411c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:34)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "--",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/476/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/476/options.json
deleted file mode 100644
index ba5ef9dd55cc..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/476/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:34)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json
new file mode 100644
index 000000000000..c9974932443e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:34)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "++",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/477/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/477/options.json
deleted file mode 100644
index ba5ef9dd55cc..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/477/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:34)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json
new file mode 100644
index 000000000000..cf31420c53a0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:34)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "--",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/478/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/478/options.json
deleted file mode 100644
index 6faa5d0476c3..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/478/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json
new file mode 100644
index 000000000000..59618c91e2ca
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "++",
+ "prefix": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/479/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/479/options.json
deleted file mode 100644
index 6faa5d0476c3..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/479/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json
new file mode 100644
index 000000000000..0b6b047c7b58
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "--",
+ "prefix": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/480/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/480/options.json
deleted file mode 100644
index 2f502104f7d4..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/480/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json
new file mode 100644
index 000000000000..64f2c09fd91e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "++",
+ "prefix": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/481/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/481/options.json
deleted file mode 100644
index 2f502104f7d4..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/481/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json
new file mode 100644
index 000000000000..34c1b59c4e79
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "--",
+ "prefix": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/482/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/482/options.json
deleted file mode 100644
index 439ffff53e89..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/482/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:41)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json
new file mode 100644
index 000000000000..35af060b7c6e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:41)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 32,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 48,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/483/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/483/options.json
deleted file mode 100644
index ad15b27f9b9a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/483/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:41)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json
new file mode 100644
index 000000000000..7419ba446dc9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:41)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 32,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 53,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/484/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/484/options.json
deleted file mode 100644
index 1eb91299eb1b..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/484/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json
new file mode 100644
index 000000000000..ede15490b692
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 17,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 17,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/485/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/485/options.json
deleted file mode 100644
index c903c1205ce8..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/485/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json
new file mode 100644
index 000000000000..aeccd1a07ed9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 22,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 22,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/486/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/486/options.json
deleted file mode 100644
index 884ab94e3403..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/486/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:42)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json
new file mode 100644
index 000000000000..4e8af9c85d04
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json
@@ -0,0 +1,214 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:42)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 33,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 33,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 49
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/487/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/487/options.json
deleted file mode 100644
index 58a98e4ca953..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/487/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:42)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json
new file mode 100644
index 000000000000..49a2e0086f28
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json
@@ -0,0 +1,214 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:42)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 60
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 33,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 33,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/488/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/488/options.json
deleted file mode 100644
index aa44c4aafa4d..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/488/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json
new file mode 100644
index 000000000000..6d1387258a3e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/489/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/489/options.json
deleted file mode 100644
index 59ccf8eb8209..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/489/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json
new file mode 100644
index 000000000000..d3b5c3628386
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 23,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 23,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/490/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/490/options.json
deleted file mode 100644
index e95a2d7f7535..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/490/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:47)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json
new file mode 100644
index 000000000000..d0eb8e29b2a1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json
@@ -0,0 +1,250 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:47)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 35,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "FunctionExpression",
+ "start": 38,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/491/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/491/options.json
deleted file mode 100644
index e29c7aee6091..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/491/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'package' in strict mode (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json
new file mode 100644
index 000000000000..d6510094936e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'package' in strict mode (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "package"
+ },
+ "name": "package"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 21,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 21,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/492/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/492/options.json
deleted file mode 100644
index 43dc5662e1e5..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/492/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:48)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json
new file mode 100644
index 000000000000..98e096877880
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json
@@ -0,0 +1,292 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:48)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 35,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 38,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ },
+ {
+ "type": "ObjectMethod",
+ "start": 42,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 46,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 46
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "kind": "set",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 48,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/493/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/493/options.json
deleted file mode 100644
index 439ffff53e89..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/493/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:41)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json
new file mode 100644
index 000000000000..f974d83f5a98
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json
@@ -0,0 +1,237 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:41)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 35,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "kind": "set",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 41,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 47,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/494/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/494/options.json
deleted file mode 100644
index 8b18a4ec3e5a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/494/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:49)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json
new file mode 100644
index 000000000000..2993cf648835
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json
@@ -0,0 +1,268 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 64
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:49)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 64
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 64
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 64
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 60
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 35,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "FunctionExpression",
+ "start": 38,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 49,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 49
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 55,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 55
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/495/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/495/options.json
deleted file mode 100644
index 794c4864d4e5..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/495/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json
new file mode 100644
index 000000000000..4534376b270a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 22,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 22,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/496/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/496/options.json
deleted file mode 100644
index 212d35fcb5fe..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/496/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json
new file mode 100644
index 000000000000..cb41c2783446
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 27,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 27,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/497/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/497/options.json
deleted file mode 100644
index 43dc5662e1e5..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/497/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:48)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json
new file mode 100644
index 000000000000..d8df2c1c2d07
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:48)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 33,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "inner"
+ },
+ "name": "inner"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 48,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/498/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/498/options.json
deleted file mode 100644
index 8370ba5c765f..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/498/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:48)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json
new file mode 100644
index 000000000000..a2fc6cb4db0e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:48)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 33,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "inner"
+ },
+ "name": "inner"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 48,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 59,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 59
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/499/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/499/options.json
deleted file mode 100644
index ae2bfab55c68..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/499/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:35)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json
new file mode 100644
index 000000000000..1504ace4ac5d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:35)",
+ "SyntaxError: Octal literal in strict mode (1:35)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ },
+ {
+ "type": "Directive",
+ "start": 33,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 33,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "value": "\\1",
+ "extra": {
+ "raw": "\"\\1\"",
+ "rawValue": "\\1"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/500/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/500/options.json
deleted file mode 100644
index 45ca229c1e8e..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/500/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json
new file mode 100644
index 000000000000..805c176e7856
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)",
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 33,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 33,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "021"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/501/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/501/options.json
deleted file mode 100644
index 7e50b5f9165e..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/501/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:38)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json
new file mode 100644
index 000000000000..f73cb42cd9cf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json
@@ -0,0 +1,221 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:38)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 33,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 34,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 36,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "extra": {
+ "rawValue": "\u0001",
+ "raw": "\"\\1\""
+ },
+ "value": "\u0001"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 42,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 33
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/502/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/502/options.json
deleted file mode 100644
index 8f6c8218f747..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/502/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json
new file mode 100644
index 000000000000..5eb3bcef0b18
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json
@@ -0,0 +1,221 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 33,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 34,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 36,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "NumericLiteral",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "021"
+ },
+ "value": 17
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 41,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 33
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/503/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/503/options.json
deleted file mode 100644
index 8389b2c726ca..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/503/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:69)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json
new file mode 100644
index 000000000000..e52fa38ccf73
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json
@@ -0,0 +1,215 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:69)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 33,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 74
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "inner"
+ },
+ "name": "inner"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 50,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 50
+ },
+ "end": {
+ "line": 1,
+ "column": 74
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 52,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 52
+ },
+ "end": {
+ "line": 1,
+ "column": 72
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 52,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 52
+ },
+ "end": {
+ "line": 1,
+ "column": 71
+ }
+ },
+ "value": "octal directive\\1",
+ "extra": {
+ "raw": "\"octal directive\\1\"",
+ "rawValue": "octal directive\\1"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/504/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/504/options.json
deleted file mode 100644
index 0641de45e29a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/504/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'implements' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json
new file mode 100644
index 000000000000..2201ea3de8c6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'implements' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "implements"
+ },
+ "name": "implements"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/505/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/505/options.json
deleted file mode 100644
index 859238d0423f..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/505/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'interface' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json
new file mode 100644
index 000000000000..be76deabc7a1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'interface' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "interface"
+ },
+ "name": "interface"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/506/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/506/options.json
deleted file mode 100644
index 344c7075f4bf..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/506/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'package' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json
new file mode 100644
index 000000000000..414e229fac38
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'package' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ },
+ "identifierName": "package"
+ },
+ "name": "package"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/507/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/507/options.json
deleted file mode 100644
index 9fb9deaf9cba..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/507/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'private' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json
new file mode 100644
index 000000000000..32efcd46a632
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'private' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ },
+ "identifierName": "private"
+ },
+ "name": "private"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/508/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/508/options.json
deleted file mode 100644
index 292fb56f1cf3..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/508/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'protected' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json
new file mode 100644
index 000000000000..e3d3f255c253
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'protected' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "protected"
+ },
+ "name": "protected"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/509/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/509/options.json
deleted file mode 100644
index d5f48446906a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/509/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'public' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json
new file mode 100644
index 000000000000..2e801038c78d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'public' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "public"
+ },
+ "name": "public"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/510/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/510/options.json
deleted file mode 100644
index 0f41ff2e6f24..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/510/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'static' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json
new file mode 100644
index 000000000000..4ed420518d6d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'static' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/511/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/511/options.json
deleted file mode 100644
index 78c799ec6a49..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/511/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'static' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json
new file mode 100644
index 000000000000..ab669586dc27
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'static' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 25,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 25,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/512/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/512/options.json
deleted file mode 100644
index d4a2d92e5b45..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/512/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'static' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json
new file mode 100644
index 000000000000..be76a2099b54
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'static' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 20,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/513/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/513/options.json
deleted file mode 100644
index 91bc36d3f360..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/513/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'static' (1:23)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json
new file mode 100644
index 000000000000..c249f39209bf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'static' (1:23)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/514/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/514/options.json
deleted file mode 100644
index 8b20b9a7df36..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/514/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json
new file mode 100644
index 000000000000..f945eeb57491
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/515/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/515/options.json
deleted file mode 100644
index 85fd3822f433..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/515/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json
new file mode 100644
index 000000000000..f2ff5d38de33
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/516/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/516/options.json
deleted file mode 100644
index 604b5896c2c5..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/516/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'package' in strict mode (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json
new file mode 100644
index 000000000000..2f734055a47a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'package' in strict mode (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "package"
+ },
+ "name": "package"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 22,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 22,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/517/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/517/options.json
deleted file mode 100644
index 9d2a58081596..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/517/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:43)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json
new file mode 100644
index 000000000000..60ac3ce8c98c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json
@@ -0,0 +1,229 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:43)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 29,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 43,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 43
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 46,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 46
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 49,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 49
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/518/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/518/options.json
deleted file mode 100644
index 61c3bbb5abe0..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/518/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json
new file mode 100644
index 000000000000..766ec14c5a33
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json
@@ -0,0 +1,180 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 20,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/519/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/519/options.json
deleted file mode 100644
index ae469fbd59da..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/519/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:44)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json
new file mode 100644
index 000000000000..0f2e3c5dce01
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json
@@ -0,0 +1,233 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:44)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 30,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 44,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 44
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 47,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 29
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/520/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/520/options.json
deleted file mode 100644
index b60957f217a4..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/520/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json
new file mode 100644
index 000000000000..7945e482ca86
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 20,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/521/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/521/options.json
deleted file mode 100644
index 62075401e782..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/521/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'package' in strict mode (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json
new file mode 100644
index 000000000000..304b4237e9e7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'package' in strict mode (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "package"
+ },
+ "name": "package"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 23,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 23,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/522/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/522/options.json
deleted file mode 100644
index 0b443b9bacfa..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/522/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (1:65)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json
new file mode 100644
index 000000000000..98d2e052715b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json
@@ -0,0 +1,285 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 69
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:65)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 69
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 13,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 28,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 28,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 42,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 69
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 51,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 51
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 56,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 56
+ },
+ "end": {
+ "line": 1,
+ "column": 69
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 57,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 57
+ },
+ "end": {
+ "line": 1,
+ "column": 68
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 61,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 61
+ },
+ "end": {
+ "line": 1,
+ "column": 68
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 61
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ },
+ "identifierName": "v"
+ },
+ "name": "v"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 65,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 65
+ },
+ "end": {
+ "line": 1,
+ "column": 68
+ }
+ },
+ "extra": {
+ "rawValue": 13,
+ "raw": "015"
+ },
+ "value": 13
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/523/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/523/options.json
deleted file mode 100644
index 60a9d5934bd2..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/523/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'this' (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json
new file mode 100644
index 000000000000..90808a26c8be
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'this' (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "this"
+ },
+ "name": "this"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/524/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/524/options.json
deleted file mode 100644
index d07b41872ba6..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/524/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal newline after throw (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json
new file mode 100644
index 000000000000..55552e2994ca
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal newline after throw (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ThrowStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/544/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/544/options.json
deleted file mode 100644
index 37c243afff2a..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/544/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'public' (2:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json
new file mode 100644
index 000000000000..d3b1ca7ae09c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json
@@ -0,0 +1,212 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'public' (2:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 20,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 20,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 22,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "public"
+ },
+ "name": "public"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "public"
+ },
+ "name": "public"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 33,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json
index b09fdddc9d0a..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'public' (1:8)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json
new file mode 100644
index 000000000000..34af0a196c39
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'public' (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 6,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 8,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "public"
+ },
+ "name": "public"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "public"
+ },
+ "name": "public"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 19,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/547/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/547/options.json
deleted file mode 100644
index c2fb6377e80d..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/547/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'arguments' (2:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json
new file mode 100644
index 000000000000..39ef331a20b1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json
@@ -0,0 +1,213 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'arguments' (2:8)",
+ "SyntaxError: Binding 'arguments' in strict mode (2:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 20,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 20,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 22,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json
index 4183c2e22534..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'arguments' (1:8)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json
new file mode 100644
index 000000000000..132483692bbd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json
@@ -0,0 +1,177 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'arguments' (1:8)",
+ "SyntaxError: Binding 'arguments' in strict mode (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 6,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 8,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 22,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/550/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/550/options.json
deleted file mode 100644
index 5cee88d901e4..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/550/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (2:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json
new file mode 100644
index 000000000000..9b383cded8fd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 20,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "extra": {
+ "rawValue": 7,
+ "raw": "07"
+ },
+ "value": 7
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/552/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/552/options.json
deleted file mode 100644
index 5cee88d901e4..000000000000
--- a/packages/babel-parser/test/fixtures/core/uncategorised/552/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (2:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json
new file mode 100644
index 000000000000..a7d3e10860a2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 20,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "extra": {
+ "rawValue": 8,
+ "raw": "08"
+ },
+ "value": 8
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json
index eff49cbfba64..6d24025b8674 100644
--- a/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json
@@ -1,4 +1,3 @@
{
- "createParenthesizedExpressions": true,
- "throws": "You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)"
-}
+ "createParenthesizedExpressions": true
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json
new file mode 100644
index 000000000000..448578186a0a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json
@@ -0,0 +1,228 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ParenthesizedExpression",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 8,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json
index f37c4bc95c57..6d24025b8674 100644
--- a/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json
@@ -1,4 +1,3 @@
{
- "createParenthesizedExpressions": true,
- "throws": "You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)"
-}
+ "createParenthesizedExpressions": true
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json
new file mode 100644
index 000000000000..e2a0d2a8ba52
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ParenthesizedExpression",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ]
+ }
+ },
+ "right": {
+ "type": "ArrayExpression",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/options.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/options.json
deleted file mode 100644
index 7931fd924fcd..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected trailing comma after rest element (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json
new file mode 100644
index 000000000000..3d5c2a07c806
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected trailing comma after rest element (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ArrayPattern",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "trailingComma": 5
+ },
+ "elements": [
+ {
+ "type": "RestElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "ArrayExpression",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "elements": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json
deleted file mode 100644
index 0b0d3c532d1e..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected trailing comma after rest element (1:10)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json
new file mode 100644
index 000000000000..f97d7f0db889
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json
@@ -0,0 +1,136 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected trailing comma after rest element (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "left": {
+ "type": "ArrayPattern",
+ "start": 5,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "extra": {
+ "trailingComma": 10
+ },
+ "elements": [
+ {
+ "type": "RestElement",
+ "start": 6,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "ArrayExpression",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "elements": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json
deleted file mode 100644
index 95a846d785a8..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected trailing comma after rest element (1:6)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json
new file mode 100644
index 000000000000..4cbc33abae7e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected trailing comma after rest element (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ArrayPattern",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "trailingComma": 6
+ },
+ "elements": [
+ {
+ "type": "RestElement",
+ "start": 2,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "right": {
+ "type": "ArrayExpression",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "elements": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/comma-after-rest-param/options.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/comma-after-rest-param/options.json
index 38fec89ef15c..5ed0b104c003 100644
--- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/comma-after-rest-param/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/comma-after-rest-param/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Unexpected trailing comma after rest element (1:8)"
-}
+ "throws": "Unexpected token, expected \")\" (1:8)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/options.json
deleted file mode 100644
index 660e644cf6a5..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "super is only allowed in object methods and classes (4:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json
new file mode 100644
index 000000000000..6a343317ea61
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json
@@ -0,0 +1,340 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: super is only allowed in object methods and classes (4:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "callee": {
+ "type": "MemberExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "Object"
+ },
+ "name": "Object"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "create"
+ },
+ "name": "create"
+ },
+ "computed": false
+ },
+ "arguments": [
+ {
+ "type": "ObjectExpression",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "properties": []
+ },
+ {
+ "type": "ObjectExpression",
+ "start": 18,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 22,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ObjectExpression",
+ "start": 27,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 33,
+ "end": 79,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ },
+ "identifierName": "get"
+ },
+ "name": "get"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "FunctionExpression",
+ "start": 38,
+ "end": 79,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 48,
+ "end": 79,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 56,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "argument": {
+ "type": "MemberExpression",
+ "start": 63,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ }
+ },
+ "object": {
+ "type": "Super",
+ "start": 63,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 69,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json
deleted file mode 100644
index 9461325c423a..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (2:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json
new file mode 100644
index 000000000000..65fe6001d2c6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json
@@ -0,0 +1,191 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (2:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 18,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "callee": {
+ "type": "Super",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/options.json
deleted file mode 100644
index a848b7de671a..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (2:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json
new file mode 100644
index 000000000000..328e55a13f5d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 16,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json
deleted file mode 100644
index 524ed587e113..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Classes may not have static property named prototype (2:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json
new file mode 100644
index 000000000000..0ffcd2fd0520
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have static property named prototype (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "static": true,
+ "kind": "method",
+ "key": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "prototype"
+ },
+ "name": "prototype"
+ },
+ "computed": false,
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/options.json
deleted file mode 100644
index f30c8a49abd3..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Classes may not have static property named prototype (2:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json
new file mode 100644
index 000000000000..f78f786f6aa9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have static property named prototype (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "static": true,
+ "key": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "prototype"
+ },
+ "name": "prototype"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/options.json
deleted file mode 100644
index 65bc24a66fcd..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "getter must not have any formal parameters (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json
new file mode 100644
index 000000000000..1f5262e935f3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: getter must not have any formal parameters (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "prop"
+ },
+ "name": "prop"
+ },
+ "computed": false,
+ "kind": "get",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "arg"
+ },
+ "name": "arg"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/options.json
deleted file mode 100644
index dc41f0b14b5a..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token (3:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json
new file mode 100644
index 000000000000..6ecafb90e3ab
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json
@@ -0,0 +1,211 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 23,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 23,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "left": {
+ "type": "Super",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "operator": "-",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/options.json b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/options.json
deleted file mode 100644
index 09a1c52e4354..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'with' in strict mode (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json
new file mode 100644
index 000000000000..efd21a8e7118
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json
@@ -0,0 +1,237 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: 'with' in strict mode (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "superClass": {
+ "type": "CallExpression",
+ "start": 17,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 17,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 30,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "WithStatement",
+ "start": 34,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "object": {
+ "type": "ObjectExpression",
+ "start": 40,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 43,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ }
+ },
+ {
+ "type": "ReturnStatement",
+ "start": 47,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 54,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 16
+ }
+ },
+ "body": {
+ "type": "ClassBody",
+ "start": 62,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 5
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/input.js b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/input.js
index 11cebfa18894..42403a50ea26 100644
--- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/input.js
@@ -1 +1 @@
-var { this };
+var { this } = {};
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/options.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/options.json
deleted file mode 100644
index 1b54b61689e7..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'this' (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json
new file mode 100644
index 000000000000..7d830d569103
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json
@@ -0,0 +1,159 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'this' (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 4,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 6,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "this"
+ },
+ "name": "this"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "this"
+ },
+ "name": "this"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/options.json b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/options.json
deleted file mode 100644
index f52857170baa..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Only '=' operator can be used for specifying default value. (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json
new file mode 100644
index 000000000000..5a29fd6b5f7b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json
@@ -0,0 +1,156 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Only '=' operator can be used for specifying default value. (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 1,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "AssignmentPattern",
+ "start": 2,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/options.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/options.json
deleted file mode 100644
index dfcad1b5cbf0..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json
new file mode 100644
index 000000000000..111c55cd65bd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json
@@ -0,0 +1,127 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/options.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/options.json
deleted file mode 100644
index d0fb48924093..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json
new file mode 100644
index 000000000000..34adca287e3e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json
@@ -0,0 +1,165 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json
deleted file mode 100644
index 2a64fa7c20ad..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-loop (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json
new file mode 100644
index 000000000000..bde13b8bdbda
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json
@@ -0,0 +1,187 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-loop (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "ForInStatement",
+ "start": 7,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "left": {
+ "type": "AssignmentPattern",
+ "start": 12,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json
deleted file mode 100644
index 68677faac9b9..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-in loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json
new file mode 100644
index 000000000000..b85f54f50027
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json
deleted file mode 100644
index 68677faac9b9..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-in loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json
new file mode 100644
index 000000000000..d890ea49e1da
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 18,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json
deleted file mode 100644
index 1fa21b020d65..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-in loop variable declaration may not have an initializer (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json
new file mode 100644
index 000000000000..556eea44650d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json
@@ -0,0 +1,190 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: for-in loop variable declaration may not have an initializer (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json
deleted file mode 100644
index 68677faac9b9..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-in loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json
new file mode 100644
index 000000000000..fbffb7c6994a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json
@@ -0,0 +1,171 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ]
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json
deleted file mode 100644
index 68677faac9b9..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-in loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json
new file mode 100644
index 000000000000..0afdc7b4d271
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json
deleted file mode 100644
index 2a64fa7c20ad..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-loop (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json
new file mode 100644
index 000000000000..936a7b0183e3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json
@@ -0,0 +1,188 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-loop (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "ForOfStatement",
+ "start": 7,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "await": false,
+ "left": {
+ "type": "AssignmentPattern",
+ "start": 12,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/input.js b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/input.js
index 521b91facbbc..8a89e37a1275 100644
--- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/input.js
@@ -1 +1 @@
-(function* () { y\u0069eld 10 })
+(function* () { y\u0069eld; })
diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json
deleted file mode 100644
index 67305b830e87..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json
new file mode 100644
index 000000000000..6d1a2d6c3fce
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 16,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/options.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/options.json
deleted file mode 100644
index 8cdac51705a1..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Generators can only be declared at the top level or inside a block (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json
new file mode 100644
index 000000000000..0059c885f4d8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Generators can only be declared at the top level or inside a block (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "IfStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "test": {
+ "type": "NumericLiteral",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "consequent": {
+ "type": "FunctionDeclaration",
+ "start": 7,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "alternate": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/input.js b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/input.js
index 7db67c0d2dc7..3ec83f02b2f4 100644
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/input.js
@@ -1 +1,3 @@
var co\u{6e}st = 123;
+
+co\u{6e}st x = 2;
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/options.json
deleted file mode 100644
index d6c0b22e3090..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Escape sequence in keyword const (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json
new file mode 100644
index 000000000000..f5d632c23ace
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json
@@ -0,0 +1,180 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'const' (1:4)",
+ "SyntaxError: Escape sequence in keyword const (1:4)",
+ "SyntaxError: Escape sequence in keyword const (3:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "const"
+ },
+ "name": "const"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 123,
+ "raw": "123"
+ },
+ "value": 123
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 23,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 34,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/input.js b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/input.js
index 2c49151ea912..c9bc4e4c28d9 100644
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/input.js
@@ -1 +1,4 @@
var expor\u{74} = 123;
+
+var x;
+expor\u{74} { x };
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json
index 80870219d5cc..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Escape sequence in keyword export (1:15)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json
new file mode 100644
index 000000000000..236b7dc15afa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json
@@ -0,0 +1,229 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'export' (1:4)",
+ "SyntaxError: Escape sequence in keyword export (1:4)",
+ "SyntaxError: Escape sequence in keyword export (4:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "export"
+ },
+ "name": "export"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "extra": {
+ "rawValue": 123,
+ "raw": "123"
+ },
+ "value": 123
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 24,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 31,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 45,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 45,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 45,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/options.json
deleted file mode 100644
index 52faf91d3656..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Escape sequence in keyword if (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json
new file mode 100644
index 000000000000..d95df678e8c4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Escape sequence in keyword if (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "IfStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": true
+ },
+ "consequent": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "alternate": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/input.js b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/input.js
index f23c79e20fb1..df174d0e56d1 100644
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/input.js
@@ -1 +1,3 @@
var \u{69}\u{6d}\u{70}\u{6f}\u{72}\u{74} = 123;
+
+\u{69}\u{6d}\u{70}\u{6f}\u{72}\u{74} "x";
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json
index 45763ffa389b..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Escape sequence in keyword import (1:40)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json
new file mode 100644
index 000000000000..8842ac412ce6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 90,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'import' (1:4)",
+ "SyntaxError: Escape sequence in keyword import (1:4)",
+ "SyntaxError: Escape sequence in keyword import (3:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 90,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "import"
+ },
+ "name": "import"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 43
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "extra": {
+ "rawValue": 123,
+ "raw": "123"
+ },
+ "value": 123
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "ImportDeclaration",
+ "start": 49,
+ "end": 90,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "specifiers": [],
+ "source": {
+ "type": "StringLiteral",
+ "start": 86,
+ "end": 89,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 40
+ }
+ },
+ "extra": {
+ "rawValue": "x",
+ "raw": "\"x\""
+ },
+ "value": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/options.json
deleted file mode 100644
index 34db9f6413ed..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Escape sequence in keyword null (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json
new file mode 100644
index 000000000000..17c1ae03468e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json
@@ -0,0 +1,68 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Escape sequence in keyword null (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NullLiteral",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/options.json
deleted file mode 100644
index c1c2620da097..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Escape sequence in keyword true (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json
new file mode 100644
index 000000000000..609a782c235a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json
@@ -0,0 +1,69 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Escape sequence in keyword true (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "BooleanLiteral",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": true
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/options.json
deleted file mode 100644
index ab238c8bbff9..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'let' (2:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json
new file mode 100644
index 000000000000..85fa32674b37
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json
@@ -0,0 +1,142 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'let' (2:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 14,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/options.json
deleted file mode 100644
index 75f41b260f56..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json
new file mode 100644
index 000000000000..e6e2ced3bb0c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json
@@ -0,0 +1,159 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 4,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/options.json
deleted file mode 100644
index 0a2459ae24fc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json
new file mode 100644
index 000000000000..2c3d3871ec80
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json
@@ -0,0 +1,159 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 6,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/options.json
deleted file mode 100644
index 80b209cf3816..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json
new file mode 100644
index 000000000000..4354932c617c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json
@@ -0,0 +1,121 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ }
+ ]
+ },
+ "init": {
+ "type": "ArrayExpression",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "elements": []
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/options.json
deleted file mode 100644
index ccbcbd4b6bbc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json
new file mode 100644
index 000000000000..720c37df7a15
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json
@@ -0,0 +1,121 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 7,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ }
+ ]
+ },
+ "init": {
+ "type": "ArrayExpression",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "elements": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/options.json
deleted file mode 100644
index 6152a659dcca..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json
new file mode 100644
index 000000000000..93d70aa80f8b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json
@@ -0,0 +1,89 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/options.json
deleted file mode 100644
index 75f41b260f56..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json
new file mode 100644
index 000000000000..77846750f6ed
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "init": {
+ "type": "StringLiteral",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": "",
+ "raw": "''"
+ },
+ "value": ""
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json
deleted file mode 100644
index 2c54a7452db9..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (2:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json
new file mode 100644
index 000000000000..ecd45f67f5c5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 7,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "err"
+ },
+ "name": "err"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 23,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 27,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/options.json
deleted file mode 100644
index 4931a93f395d..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "new.target can only be used in functions (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json
new file mode 100644
index 000000000000..64d4a8d35758
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: new.target can only be used in functions (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "ArrowFunctionExpression",
+ "start": 10,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "MetaProperty",
+ "start": 20,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "new"
+ },
+ "name": "new"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "target"
+ },
+ "name": "target"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/input.js b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/input.js
index d775807ddef1..1f159ebd65d2 100644
--- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/input.js
@@ -1 +1,3 @@
-new.prop
\ No newline at end of file
+function f() {
+ new.prop
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json
deleted file mode 100644
index 8a88f91714d0..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The only valid meta property for new is new.target (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json
new file mode 100644
index 000000000000..214b3e5417fe
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json
@@ -0,0 +1,155 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: The only valid meta property for new is new.target (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 17,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "MetaProperty",
+ "start": 17,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "new"
+ },
+ "name": "new"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "prop"
+ },
+ "name": "prop"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/options.json
deleted file mode 100644
index 112b0adc3e61..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Escape sequence in keyword new (1:23)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json
new file mode 100644
index 000000000000..1394b19bdb01
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json
@@ -0,0 +1,155 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: Escape sequence in keyword new (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 15,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "MetaProperty",
+ "start": 15,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "new"
+ },
+ "name": "new"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "target"
+ },
+ "name": "target"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/options.json
deleted file mode 100644
index 09a27d63dba1..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The only valid meta property for new is new.target (1:19)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json
new file mode 100644
index 000000000000..2fa8e1dd5500
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json
@@ -0,0 +1,155 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: The only valid meta property for new is new.target (1:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 15,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "MetaProperty",
+ "start": 15,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "new"
+ },
+ "name": "new"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "target"
+ },
+ "name": "target"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/options.json
deleted file mode 100644
index 092a825444ad..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "new.target can only be used in functions (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json
new file mode 100644
index 000000000000..4283f53e7dea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json
@@ -0,0 +1,102 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: new.target can only be used in functions (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "MetaProperty",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "new"
+ },
+ "name": "new"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "target"
+ },
+ "name": "target"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json
index 275e6a57f95f..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Only one default export allowed per module. (2:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json
new file mode 100644
index 000000000000..019d83e37ab4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json
@@ -0,0 +1,173 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Only one default export allowed per module. (2:9)",
+ "SyntaxError: Export 'foo' is not defined (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 30,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 39,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 46,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/options.json
index 1ec6a5168f14..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Only one default export allowed per module. (2:0)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json
new file mode 100644
index 000000000000..d8e83bc56d6e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json
@@ -0,0 +1,135 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Only one default export allowed per module. (2:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "declaration": {
+ "type": "ObjectExpression",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "properties": []
+ }
+ },
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 19,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 34,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 45,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/options.json
index 3bdafe893282..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/options.json
@@ -1,3 +1,3 @@
{
- "throws": "`Foo` has already been exported. Exported identifiers must be unique. (2:0)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json
new file mode 100644
index 000000000000..cf1a59d2669e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json
@@ -0,0 +1,187 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 16,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "ClassDeclaration",
+ "start": 23,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "body": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/options.json
index ea1f7f46f967..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:15)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json
new file mode 100644
index 000000000000..ae3e358fbe8c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json
@@ -0,0 +1,280 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "errors": [
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 16,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 23,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 29,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 29,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 31,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "AssignmentPattern",
+ "start": 31,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/options.json
deleted file mode 100644
index 446a980f5409..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json
new file mode 100644
index 000000000000..ba018d66dfd9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json
@@ -0,0 +1,331 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:20)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 7,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 26,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 39,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 39,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 41,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 44,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 45,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 46,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 46,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 46,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 56,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/options.json
deleted file mode 100644
index 09b3fa97a0d1..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo4' has already been declared (2:50)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json
new file mode 100644
index 000000000000..853a21053688
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json
@@ -0,0 +1,521 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 69
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo4' has already been declared (2:50)",
+ "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:50)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 69
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 7,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "foo4"
+ },
+ "name": "foo4"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 27,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 69
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 34,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 69
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 40,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 68
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 40,
+ "end": 89,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 41,
+ "end": 88,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 61
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 43,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 46,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 47,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 57,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 59
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ObjectPattern",
+ "start": 60,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 59
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 62,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 57
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ },
+ "identifierName": "foo2"
+ },
+ "name": "foo2"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 68,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 57
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 69,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 56
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 71,
+ "end": 81,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 44
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 44
+ },
+ "end": {
+ "line": 2,
+ "column": 48
+ },
+ "identifierName": "foo3"
+ },
+ "name": "foo3"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 77,
+ "end": 81,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 50
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ },
+ "identifierName": "foo4"
+ },
+ "name": "foo4"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 92,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 65
+ },
+ "end": {
+ "line": 2,
+ "column": 68
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/options.json
deleted file mode 100644
index 3a7173c837e3..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo4' has already been declared (2:49)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json
new file mode 100644
index 000000000000..9100976f570c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json
@@ -0,0 +1,504 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 67
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo4' has already been declared (2:49)",
+ "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:49)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 67
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 7,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "foo4"
+ },
+ "name": "foo4"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 27,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 67
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 34,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 67
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 40,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 66
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 40,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 60
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 42,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 45,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 46,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 48,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 56,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 58
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 56,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ObjectPattern",
+ "start": 59,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 58
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 61,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 56
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ },
+ "identifierName": "foo2"
+ },
+ "name": "foo2"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 67,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 40
+ },
+ "end": {
+ "line": 2,
+ "column": 56
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 68,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 55
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 70,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 43
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 70,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 43
+ },
+ "end": {
+ "line": 2,
+ "column": 47
+ },
+ "identifierName": "foo3"
+ },
+ "name": "foo3"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 76,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 49
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ },
+ "identifierName": "foo4"
+ },
+ "name": "foo4"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 90,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 63
+ },
+ "end": {
+ "line": 2,
+ "column": 66
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/options.json
deleted file mode 100644
index d3fc42a61ba1..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo4' has already been declared (2:58)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json
new file mode 100644
index 000000000000..63e32c488670
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json
@@ -0,0 +1,556 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 103,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 76
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo4' has already been declared (2:58)",
+ "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:58)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 103,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 76
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 7,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "foo4"
+ },
+ "name": "foo4"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 27,
+ "end": 103,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 76
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 34,
+ "end": 103,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 76
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 40,
+ "end": 102,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 75
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 40,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 69
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 42,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 45,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 46,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 48,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "foo4"
+ },
+ "name": "foo4"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 65,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 67
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ObjectPattern",
+ "start": 68,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 67
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 70,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 43
+ },
+ "end": {
+ "line": 2,
+ "column": 65
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 70,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 43
+ },
+ "end": {
+ "line": 2,
+ "column": 47
+ },
+ "identifierName": "foo2"
+ },
+ "name": "foo2"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 76,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 49
+ },
+ "end": {
+ "line": 2,
+ "column": 65
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 77,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 50
+ },
+ "end": {
+ "line": 2,
+ "column": 64
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 79,
+ "end": 89,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 52
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 79,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 52
+ },
+ "end": {
+ "line": 2,
+ "column": 56
+ },
+ "identifierName": "foo3"
+ },
+ "name": "foo3"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 85,
+ "end": 89,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 58
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ },
+ "identifierName": "foo4"
+ },
+ "name": "foo4"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 99,
+ "end": 102,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 72
+ },
+ "end": {
+ "line": 2,
+ "column": 75
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/options.json
deleted file mode 100644
index 80640e0ce127..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json
new file mode 100644
index 000000000000..1d699b58133a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json
@@ -0,0 +1,262 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:21)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 22,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 35,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "foo2"
+ },
+ "name": "foo2"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 51,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/options.json
deleted file mode 100644
index ea3a9b62f493..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo2' has already been declared (2:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json
new file mode 100644
index 000000000000..140798f03a2d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json
@@ -0,0 +1,262 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo2' has already been declared (2:13)",
+ "SyntaxError: `foo2` has already been exported. Exported identifiers must be unique. (2:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 13,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "foo2"
+ },
+ "name": "foo2"
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 34,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 41,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 47,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "foo2"
+ },
+ "name": "foo2"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 54,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/options.json
deleted file mode 100644
index 42c862ad273a..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json
new file mode 100644
index 000000000000..d51c3a34e349
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json
@@ -0,0 +1,259 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:22)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 22,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 35,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ {
+ "type": "RestElement",
+ "start": 41,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 51,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/options.json
deleted file mode 100644
index 125c2618435d..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'bar' has already been declared (2:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json
new file mode 100644
index 000000000000..5d56b3c37e96
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json
@@ -0,0 +1,259 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'bar' has already been declared (2:13)",
+ "SyntaxError: `bar` has already been exported. Exported identifiers must be unique. (2:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 13,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ {
+ "type": "RestElement",
+ "start": 19,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 34,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 41,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 47,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 53,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/options.json
deleted file mode 100644
index bf345ea77127..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:28)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json
new file mode 100644
index 000000000000..0378d078ec4f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json
@@ -0,0 +1,293 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:28)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:28)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 22,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 35,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ {
+ "type": "ArrayPattern",
+ "start": 41,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 42,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ {
+ "type": "RestElement",
+ "start": 47,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 50,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ },
+ "identifierName": "qux"
+ },
+ "name": "qux"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/options.json
deleted file mode 100644
index bf2483362193..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:29)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json
new file mode 100644
index 000000000000..e185b7f4186f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json
@@ -0,0 +1,311 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:29)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:29)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 22,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 35,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 37,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ArrayPattern",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ {
+ "type": "RestElement",
+ "start": 48,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 51,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 60,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ },
+ "identifierName": "qux"
+ },
+ "name": "qux"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/options.json
deleted file mode 100644
index 2cbe06c40914..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json
new file mode 100644
index 000000000000..8e8c195325fc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json
@@ -0,0 +1,262 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:15)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 7,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 26,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 39,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 39,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/options.json
deleted file mode 100644
index d36390356990..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json
new file mode 100644
index 000000000000..f862a6a420c6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json
@@ -0,0 +1,262 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:16)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 28,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 35,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 50,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 52,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/options.json
deleted file mode 100644
index 46358493589c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json
new file mode 100644
index 000000000000..401baa93a85a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json
@@ -0,0 +1,224 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:14)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 7,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 26,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 39,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 39,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 40,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/options.json
deleted file mode 100644
index d36390356990..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json
new file mode 100644
index 000000000000..39b035aada97
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json
@@ -0,0 +1,224 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:16)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 13,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 26,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 33,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 48,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 50,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/options.json
deleted file mode 100644
index 46358493589c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json
new file mode 100644
index 000000000000..d4856c9023d7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json
@@ -0,0 +1,279 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:14)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 28,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 35,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 41,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 41,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 42,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "bar2"
+ },
+ "name": "bar2"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/options.json
deleted file mode 100644
index 2cbe06c40914..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'foo' has already been declared (2:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json
new file mode 100644
index 000000000000..3bfd361f5286
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json
@@ -0,0 +1,279 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:15)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 13,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 26,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 39,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 39,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ },
+ "identifierName": "bar2"
+ },
+ "name": "bar2"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/options.json
deleted file mode 100644
index 982078d803c6..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'Foo' has already been declared (2:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json
new file mode 100644
index 000000000000..5826aac519d7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json
@@ -0,0 +1,259 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'Foo' has already been declared (2:15)",
+ "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "ClassDeclaration",
+ "start": 7,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 21,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 28,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 34,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 34,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/options.json
deleted file mode 100644
index f79b5469b1c0..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'Foo' has already been declared (2:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json
new file mode 100644
index 000000000000..4ee921df359a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json
@@ -0,0 +1,221 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'Foo' has already been declared (2:14)",
+ "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "ClassDeclaration",
+ "start": 7,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 21,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 28,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 34,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 34,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/options.json
index 1923e4752336..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/options.json
@@ -1,3 +1,3 @@
{
- "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:0)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json
new file mode 100644
index 000000000000..ac8f210f8ba9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json
@@ -0,0 +1,190 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 16,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 23,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 38,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/options.json
index 9fdf7082da17..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/options.json
@@ -1,3 +1,3 @@
{
- "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:13)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json
new file mode 100644
index 000000000000..981050ec6112
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json
@@ -0,0 +1,190 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 16,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 23,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 29,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/options.json
index 9bb46f4778eb..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/options.json
@@ -1,3 +1,3 @@
{
- "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json
new file mode 100644
index 000000000000..b6476d620353
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:9)",
+ "SyntaxError: Export 'foo' is not defined (1:9)",
+ "SyntaxError: Export 'bar' is not defined (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 16,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 25,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/options.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/options.json
index 379fb1f86234..3c8ee8805e34 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/options.json
@@ -1,4 +1,6 @@
{
- "plugins": ["flow"],
- "throws": "Unexpected keyword 'default' (1:9)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json
new file mode 100644
index 000000000000..d1f169eb7647
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'default' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ },
+ "importKind": null,
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ }
+ }
+ ],
+ "importKind": "value",
+ "source": {
+ "type": "StringLiteral",
+ "start": 24,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/options.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/options.json
index cda01e8412c3..3c8ee8805e34 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/options.json
@@ -1,4 +1,6 @@
{
- "plugins": ["flow"],
- "throws": "Unexpected keyword 'typeof' (1:9)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json
new file mode 100644
index 000000000000..62e2b403628d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'typeof' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "typeof"
+ },
+ "name": "typeof"
+ },
+ "importKind": null,
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "typeof"
+ },
+ "name": "typeof"
+ }
+ }
+ ],
+ "importKind": "value",
+ "source": {
+ "type": "StringLiteral",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/options.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/options.json
index a45cdb986dd1..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Unexpected keyword 'typeof' (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json
new file mode 100644
index 000000000000..cd60a3c49fe9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json
@@ -0,0 +1,124 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'typeof' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "typeof"
+ },
+ "name": "typeof"
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "typeof"
+ },
+ "name": "typeof"
+ }
+ }
+ ],
+ "source": {
+ "type": "StringLiteral",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/options.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/options.json
index 2c6a46df3f6e..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Unexpected keyword 'debugger' (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json
new file mode 100644
index 000000000000..40242124c0c4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json
@@ -0,0 +1,124 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'debugger' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 9,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "debugger"
+ },
+ "name": "debugger"
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "debugger"
+ },
+ "name": "debugger"
+ }
+ }
+ ],
+ "source": {
+ "type": "StringLiteral",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/options.json b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/options.json
deleted file mode 100644
index a848b7de671a..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (2:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json
new file mode 100644
index 000000000000..b9fa1b56ec84
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json
@@ -0,0 +1,165 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 7,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/options.json b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/options.json
deleted file mode 100644
index 86670c5168d0..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Duplicate regular expression flag (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json
new file mode 100644
index 000000000000..86ec306e13d1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Duplicate regular expression flag (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "RegExpLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "raw": "/./gii"
+ },
+ "pattern": ".",
+ "flags": "gii"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/1/options.json b/packages/babel-parser/test/fixtures/es2015/shorthand/1/options.json
deleted file mode 100644
index eaa26955dc77..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/shorthand/1/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'const' (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json
new file mode 100644
index 000000000000..712caaafe1a1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'const' (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "const"
+ },
+ "name": "const"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "const"
+ },
+ "name": "const"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 8
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/2/options.json b/packages/babel-parser/test/fixtures/es2015/shorthand/2/options.json
deleted file mode 100644
index be39a4451388..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/shorthand/2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'this' (1:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json
new file mode 100644
index 000000000000..c91daf2f66d8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json
@@ -0,0 +1,240 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'this' (1:8)",
+ "SyntaxError: Unexpected keyword 'if' (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 3,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "get"
+ },
+ "name": "get"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "get"
+ },
+ "name": "get"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "this"
+ },
+ "name": "this"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "this"
+ },
+ "name": "this"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "if"
+ },
+ "name": "if"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "if"
+ },
+ "name": "if"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/options.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/options.json
deleted file mode 100644
index a064a678e553..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Lexical declaration cannot appear in a single-statement context (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json
new file mode 100644
index 000000000000..b0dd4fe9c6d0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json
@@ -0,0 +1,135 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 11,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "init": {
+ "type": "NullLiteral",
+ "start": 17,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/options.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/options.json
deleted file mode 100644
index 95aaacb458f8..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Async functions can only be declared at the top level or inside a block (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json
new file mode 100644
index 000000000000..31af7aa06caf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Async functions can only be declared at the top level or inside a block (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": {
+ "type": "FunctionDeclaration",
+ "start": 5,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/options.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/options.json
deleted file mode 100644
index 3f6e90c7cd27..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Generators can only be declared at the top level or inside a block (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json
new file mode 100644
index 000000000000..5dd39402a92b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Generators can only be declared at the top level or inside a block (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "body": {
+ "type": "FunctionDeclaration",
+ "start": 5,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/options.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/options.json
deleted file mode 100644
index 1eebe15c408e..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "In strict mode code, functions can only be declared at top level or inside a block (1:35)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json
new file mode 100644
index 000000000000..782989ece4c8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json
@@ -0,0 +1,211 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "errors": [
+ "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block (1:35)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 30,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "body": {
+ "type": "FunctionDeclaration",
+ "start": 35,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 44
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 50,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 50
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 16,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 16,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json
deleted file mode 100644
index 1fc5db8949ff..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-of loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json
new file mode 100644
index 000000000000..1bc303096308
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json
@@ -0,0 +1,207 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "await": false,
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "list"
+ },
+ "name": "list"
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 25,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 25,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "process"
+ },
+ "name": "process"
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json
deleted file mode 100644
index 42317f2b92ee..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:40)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json
new file mode 100644
index 000000000000..fcaa1ad31779
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json
@@ -0,0 +1,246 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "errors": [
+ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:40)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "expression": {
+ "type": "ClassExpression",
+ "start": 15,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 23,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 24,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 38,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 40,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 40,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "callee": {
+ "type": "Super",
+ "start": 40,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 14
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/input.js
index a7bd428bbfce..83b8fa3b72d4 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/input.js
@@ -1 +1 @@
-class A { constructor() {} 'constructor'() }
\ No newline at end of file
+class A { constructor() {} 'constructor'() {} }
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/options.json
deleted file mode 100644
index 09e50a3d71c3..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Duplicate constructor in the same class (1:27)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json
new file mode 100644
index 000000000000..d4cca9c08ac4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json
@@ -0,0 +1,203 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "errors": [
+ "SyntaxError: Duplicate constructor in the same class (1:27)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 10,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "ClassMethod",
+ "start": 27,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 27,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "extra": {
+ "rawValue": "constructor",
+ "raw": "'constructor'"
+ },
+ "value": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 43,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 43
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/options.json
deleted file mode 100644
index 38e87b07044c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Constructor can't have get/set modifier (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json
new file mode 100644
index 000000000000..b1c776635e95
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Constructor can't have get/set modifier (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 10,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "get",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 28,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/options.json
deleted file mode 100644
index becf560010f4..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Constructor can't be a generator (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json
new file mode 100644
index 000000000000..8eb2f5bd2f58
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Constructor can't be a generator (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 10,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "static": false,
+ "kind": "method",
+ "key": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json
deleted file mode 100644
index b25685c6eac5..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json
new file mode 100644
index 000000000000..62466668edcb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json
@@ -0,0 +1,180 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "ObjectPattern",
+ "start": 14,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/options.json
deleted file mode 100644
index 3f09c36a5f1c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 8 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json
new file mode 100644
index 000000000000..12a024fb2c03
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0o"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/options.json
deleted file mode 100644
index 3f09c36a5f1c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 8 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json
new file mode 100644
index 000000000000..4b91f320f950
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0o9"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json
new file mode 100644
index 000000000000..9978c5342ef3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 8,
+ "raw": "0o18"
+ },
+ "value": 8
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/options.json
deleted file mode 100644
index 3f09c36a5f1c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 8 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json
new file mode 100644
index 000000000000..5d2ed2d91388
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0O"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/options.json
deleted file mode 100644
index 3f09c36a5f1c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 8 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json
new file mode 100644
index 000000000000..af4105738ef8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0O9"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json
new file mode 100644
index 000000000000..617cc13b6615
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 8,
+ "raw": "0O18"
+ },
+ "value": 8
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/options.json
deleted file mode 100644
index 40dc3da9a8f4..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 2 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json
new file mode 100644
index 000000000000..0688a297c669
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0b"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/options.json
deleted file mode 100644
index 40dc3da9a8f4..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 2 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json
new file mode 100644
index 000000000000..7281fb745a17
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0b9"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json
new file mode 100644
index 000000000000..25d711669b8b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "0b18"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json
new file mode 100644
index 000000000000..379e9db894c0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "0b12"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/options.json
deleted file mode 100644
index 40dc3da9a8f4..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 2 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json
new file mode 100644
index 000000000000..c87719ade97e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0B"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/options.json
deleted file mode 100644
index 40dc3da9a8f4..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 2 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json
new file mode 100644
index 000000000000..e82ab6ace61a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0B9"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json
new file mode 100644
index 000000000000..3726afdc10d4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "0B18"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json
new file mode 100644
index 000000000000..402fcffc9e54
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "0B12"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/216/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/216/options.json
index 77b813987217..8dfd231d943b 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/216/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/216/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Code point out of bounds (1:4)"
-}
+ "throws": "Invalid code point 1114112"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/options.json
deleted file mode 100644
index efaa7d304ccc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json
new file mode 100644
index 000000000000..6052cbe571f5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "\\u{}",
+ "extra": {
+ "raw": "\"\\u{}\"",
+ "rawValue": "\\u{}"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/options.json
deleted file mode 100644
index efaa7d304ccc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json
new file mode 100644
index 000000000000..781e807d0c94
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "\\u{FFFF",
+ "extra": {
+ "raw": "\"\\u{FFFF\"",
+ "rawValue": "\\u{FFFF"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/options.json
deleted file mode 100644
index efaa7d304ccc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json
new file mode 100644
index 000000000000..fcf4254c7a65
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "\\u{FFZ}",
+ "extra": {
+ "raw": "\"\\u{FFZ}\"",
+ "rawValue": "\\u{FFZ}"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json
new file mode 100644
index 000000000000..51d63380296a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json
@@ -0,0 +1,120 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "operator": "+=",
+ "left": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "v"
+ },
+ "name": "v"
+ }
+ ]
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "ary"
+ },
+ "name": "ary"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/options.json
deleted file mode 100644
index 7c5f08eb9ba6..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json
new file mode 100644
index 000000000000..58fa4ffd7fb9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in array destructuring pattern (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ArrayPattern",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ ]
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/input.js
index 67f4e9ae35f3..2e33b3f144ba 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/input.js
@@ -1 +1 @@
-({ obj:20 }) = 42
\ No newline at end of file
+({ obj:20 } = 42)
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/options.json
deleted file mode 100644
index e6630c3da3e8..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in object destructuring pattern (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json
new file mode 100644
index 000000000000..e758dffee7fa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json
@@ -0,0 +1,165 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 1,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 3,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 20,
+ "raw": "20"
+ },
+ "value": 20
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/input.js
index 6c808fb17ea6..7cf8d0fb9429 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/input.js
@@ -1 +1 @@
-( { get x() {} } ) = 0
\ No newline at end of file
+( { get x() {} } = 0 )
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/options.json
deleted file mode 100644
index da1e10744904..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Object pattern can't contain getter or setter (1:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json
new file mode 100644
index 000000000000..426006b7cdfb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Object pattern can't contain getter or setter (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 2,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 2,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 4,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "kind": "get",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/options.json
deleted file mode 100644
index 74c1a72d5030..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'default' (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json
new file mode 100644
index 000000000000..c725f1875b33
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'default' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json
deleted file mode 100644
index 3f171f03c70c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:44)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json
new file mode 100644
index 000000000000..2a794ddc885e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json
@@ -0,0 +1,292 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:44)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 35,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 38,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ },
+ {
+ "type": "ObjectMethod",
+ "start": 42,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 44,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 44
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 50,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 50
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/options.json
deleted file mode 100644
index a33dde469094..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json
new file mode 100644
index 000000000000..73e7c59a8b68
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json
@@ -0,0 +1,254 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 30,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 40,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 29
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/options.json
deleted file mode 100644
index 5c79fd4f4ff2..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'super' (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json
new file mode 100644
index 000000000000..c129c3fce1d1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json
@@ -0,0 +1,89 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'super' (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "super"
+ },
+ "name": "super"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/options.json
deleted file mode 100644
index 8a17d90eba69..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'default' (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json
new file mode 100644
index 000000000000..e901e11e9473
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json
@@ -0,0 +1,89 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'default' (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/options.json
deleted file mode 100644
index 8a17d90eba69..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'default' (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json
new file mode 100644
index 000000000000..635346ad81de
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json
@@ -0,0 +1,89 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'default' (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/input.js
index 49ff0434557a..5b6b54d778e4 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/input.js
@@ -1 +1 @@
-const default
\ No newline at end of file
+const default = 2
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/options.json
deleted file mode 100644
index d91e2a5bbc25..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'default' (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json
new file mode 100644
index 000000000000..760cb15ffdeb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'default' (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/input.js
index 40ac1e2b4639..7afe6af895a0 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/input.js
@@ -1 +1 @@
-"use strict"; ({ v: eval }) = obj
\ No newline at end of file
+"use strict"; ({ v: eval } = obj)
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json
deleted file mode 100644
index 084570ac7584..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json
new file mode 100644
index 000000000000..bd58e38aa176
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 15,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 15,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 17,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "v"
+ },
+ "name": "v"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 14
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/input.js
index cb924f3bb153..2e399474efe9 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/input.js
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/input.js
@@ -1 +1 @@
-"use strict"; ({ v: arguments }) = obj
\ No newline at end of file
+"use strict"; ({ v: arguments } = obj)
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json
deleted file mode 100644
index bfa460f59bbd..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json
new file mode 100644
index 000000000000..60d3496c8663
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 15,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 15,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 17,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "v"
+ },
+ "name": "v"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 14
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json
deleted file mode 100644
index 68677faac9b9..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-in loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json
new file mode 100644
index 000000000000..f42607bf0849
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json
@@ -0,0 +1,206 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "list"
+ },
+ "name": "list"
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 25,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 25,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "process"
+ },
+ "name": "process"
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json
deleted file mode 100644
index 1fc5db8949ff..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-of loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json
new file mode 100644
index 000000000000..1679566d43da
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json
@@ -0,0 +1,207 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "await": false,
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "list"
+ },
+ "name": "list"
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 25,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 25,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "process"
+ },
+ "name": "process"
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json
deleted file mode 100644
index 92845f5f2081..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json
new file mode 100644
index 000000000000..3731ec6d7b75
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json
@@ -0,0 +1,182 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:15)",
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json
deleted file mode 100644
index ad54c428a2f9..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json
new file mode 100644
index 000000000000..dbffe6547ab5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json
deleted file mode 100644
index bfa08eae293e..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json
new file mode 100644
index 000000000000..1b3ed15f002e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json
deleted file mode 100644
index 794c4864d4e5..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json
new file mode 100644
index 000000000000..6b7ae83c0ad2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json
deleted file mode 100644
index 212d35fcb5fe..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json
new file mode 100644
index 000000000000..c681755fb108
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json
deleted file mode 100644
index 794c4864d4e5..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json
new file mode 100644
index 000000000000..b8b375182e2c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json
@@ -0,0 +1,198 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ {
+ "type": "AssignmentPattern",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/options.json
deleted file mode 100644
index b99fd35222b1..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json
new file mode 100644
index 000000000000..3a5f60bdddea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/options.json
deleted file mode 100644
index 79a05e62290e..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (1:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json
new file mode 100644
index 000000000000..18c0889f74b8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "00"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/options.json
deleted file mode 100644
index 99ffc0de0153..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json
new file mode 100644
index 000000000000..a7c444dfbcdc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json
@@ -0,0 +1,113 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "00"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/options.json
deleted file mode 100644
index 99ffc0de0153..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json
new file mode 100644
index 000000000000..2d80f047d283
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)",
+ "SyntaxError: Binding invalid left-hand side in function parameter list (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 20,
+ "raw": "20"
+ },
+ "value": 20
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "00"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/options.json
deleted file mode 100644
index 5cbee309bd50..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:30)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json
new file mode 100644
index 000000000000..299c0dabdaa1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json
@@ -0,0 +1,216 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:30)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "ObjectPattern",
+ "start": 28,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/options.json
deleted file mode 100644
index 8dba9882c0dc..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:47)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json
new file mode 100644
index 000000000000..50b6eca3fddd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json
@@ -0,0 +1,392 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:47)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 25,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 27,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ObjectPattern",
+ "start": 30,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ {
+ "type": "ArrayPattern",
+ "start": 39,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 40,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 42,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ObjectPattern",
+ "start": 45,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/options.json
deleted file mode 100644
index 71f5061aff9a..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json
new file mode 100644
index 000000000000..68f6ccb7cefc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json
@@ -0,0 +1,127 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in array destructuring pattern (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 3,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 5,
+ "raw": "5"
+ },
+ "value": 5
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json
deleted file mode 100644
index a8f0b3c33031..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json
new file mode 100644
index 000000000000..db0bdfa5417b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json
@@ -0,0 +1,184 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 3,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 5,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 11,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 13,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 13,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/options.json
deleted file mode 100644
index 473cd470d4f1..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:23)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json
new file mode 100644
index 000000000000..34fe89ec4c5a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json
@@ -0,0 +1,165 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:23)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "expressions": [
+ {
+ "type": "Identifier",
+ "start": 17,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "test"
+ },
+ "name": "test"
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 15,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "",
+ "cooked": ""
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "value": {
+ "raw": "\\02",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/options.json
deleted file mode 100644
index ae24fbee33c8..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'import' and 'export' may only appear at the top level (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json
new file mode 100644
index 000000000000..42655f4b978c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json
@@ -0,0 +1,111 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: 'import' and 'export' may only appear at the top level (1:7)",
+ "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "IfStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "test": {
+ "type": "NumericLiteral",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "consequent": {
+ "type": "ImportDeclaration",
+ "start": 7,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "specifiers": [],
+ "source": {
+ "type": "StringLiteral",
+ "start": 14,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "extra": {
+ "rawValue": "acorn",
+ "raw": "\"acorn\""
+ },
+ "value": "acorn"
+ }
+ },
+ "alternate": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json
deleted file mode 100644
index 794c4864d4e5..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json
new file mode 100644
index 000000000000..49e0835c1bfc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json
deleted file mode 100644
index cc2bef2a9a34..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json
new file mode 100644
index 000000000000..85866aeddd23
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 10,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 12,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 12,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/options.json
deleted file mode 100644
index 49d27a1476b0..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Object pattern can't contain getter or setter (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json
new file mode 100644
index 000000000000..fd0a014544e3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Object pattern can't contain getter or setter (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 3,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "test"
+ },
+ "name": "test"
+ },
+ "computed": false,
+ "kind": "get",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/options.json
deleted file mode 100644
index d921abda8ff6..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Complex binding patterns require an initialization value (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json
new file mode 100644
index 000000000000..09ca9d8754be
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Complex binding patterns require an initialization value (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ]
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/options.json
deleted file mode 100644
index d921abda8ff6..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Complex binding patterns require an initialization value (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json
new file mode 100644
index 000000000000..6d0d7ab1d050
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Complex binding patterns require an initialization value (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ]
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/options.json
deleted file mode 100644
index 97818d2eea7e..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Lexical declaration cannot appear in a single-statement context (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json
new file mode 100644
index 000000000000..9b5c4b8b1857
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "init": null,
+ "test": null,
+ "update": null,
+ "body": {
+ "type": "VariableDeclaration",
+ "start": 9,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 15,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json
deleted file mode 100644
index 5718d0551359..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json
new file mode 100644
index 000000000000..cc9bdf3e164e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json
@@ -0,0 +1,171 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ArrayPattern",
+ "start": 14,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "elements": [
+ {
+ "type": "RestElement",
+ "start": 15,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "arr"
+ },
+ "name": "arr"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/333/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/333/options.json
deleted file mode 100644
index 567e40541c5b..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/333/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'eval' (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json
new file mode 100644
index 000000000000..5d9acaecea9b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json
@@ -0,0 +1,231 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'eval' (1:16)",
+ "SyntaxError: Assigning to 'eval' in strict mode (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 15,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 15,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 16,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "AssignmentPattern",
+ "start": 16,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "defValue"
+ },
+ "name": "defValue"
+ }
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 14
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json
index e31fbe3a64b9..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Assigning to 'eval' in strict mode (1:4)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json
new file mode 100644
index 000000000000..a1414d86bbf6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json
@@ -0,0 +1,135 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ArrayPattern",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "RestElement",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "arr"
+ },
+ "name": "arr"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json
new file mode 100644
index 000000000000..86383c01feb1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\07",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json
deleted file mode 100644
index ad3fdc7d73f7..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "super is only allowed in object methods and classes (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json
new file mode 100644
index 000000000000..ee3b4cb3552b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json
@@ -0,0 +1,69 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: super is only allowed in object methods and classes (1:0)",
+ "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "Super",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/options.json
deleted file mode 100644
index 9a137564eed4..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "setter must have exactly one formal parameter (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json
new file mode 100644
index 000000000000..31975621dcf1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: setter must have exactly one formal parameter (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 10,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "prop"
+ },
+ "name": "prop"
+ },
+ "computed": false,
+ "kind": "set",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/options.json
deleted file mode 100644
index c1ac8e1d138d..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json
new file mode 100644
index 000000000000..49d20172fcc8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json
@@ -0,0 +1,184 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 3,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 17,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/options.json
deleted file mode 100644
index 0d3bc321ef03..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:19)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json
new file mode 100644
index 000000000000..ba254dda4d93
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json
@@ -0,0 +1,187 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 3,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 3,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": "__proto__",
+ "raw": "'__proto__'"
+ },
+ "value": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json
index c148ada0c73a..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Can not use keyword 'await' outside an async function (1:0)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json
new file mode 100644
index 000000000000..b5f573a72f13
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use keyword 'await' outside an async function (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "right": {
+ "type": "CallExpression",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json
index fa250ba921b1..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Can not use keyword 'await' outside an async function (1:6)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json
new file mode 100644
index 000000000000..cc297fab6b9f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json
@@ -0,0 +1,121 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use keyword 'await' outside an async function (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 14,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json
index fd81c5071d1d..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Can not use keyword 'await' outside an async function (1:8)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json
new file mode 100644
index 000000000000..1bbb6a10ec2c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use keyword 'await' outside an async function (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 6,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json
index a72d4ab0ff7f..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Can not use keyword 'await' outside an async function (1:15)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json
new file mode 100644
index 000000000000..8734398fed74
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use keyword 'await' outside an async function (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 13,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json
index 18d9310bd147..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Can not use keyword 'await' outside an async function (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json
new file mode 100644
index 000000000000..9f69841ee631
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use keyword 'await' outside an async function (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json
index fa250ba921b1..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Can not use keyword 'await' outside an async function (1:6)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json
new file mode 100644
index 000000000000..12f2a4f35608
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use keyword 'await' outside an async function (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json
index 8e557dcc53af..53135cabff8f 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "script",
- "throws": "Unexpected reserved word 'enum' (1:0)"
-}
+ "sourceType": "script"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json
new file mode 100644
index 000000000000..db0bfd7b2d15
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "right": {
+ "type": "CallExpression",
+ "start": 7,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json
index 9ef8cae21e3e..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'enum' (1:0)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json
new file mode 100644
index 000000000000..7f7235704637
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "right": {
+ "type": "CallExpression",
+ "start": 7,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/options.json
deleted file mode 100644
index 401518851fb6..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json
new file mode 100644
index 000000000000..074d84652acc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding member expression (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "elements": [
+ {
+ "type": "MemberExpression",
+ "start": 2,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json
index 55bc1ec84f4a..53135cabff8f 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "script",
- "throws": "Unexpected reserved word 'enum' (1:6)"
-}
+ "sourceType": "script"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json
new file mode 100644
index 000000000000..6f19d31ea58f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json
@@ -0,0 +1,121 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 13,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json
index e6801417951e..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'enum' (1:6)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json
new file mode 100644
index 000000000000..c6e70262550d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json
@@ -0,0 +1,121 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 13,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json
index 3ef9cf1c71bb..53135cabff8f 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "script",
- "throws": "Unexpected reserved word 'enum' (1:8)"
-}
+ "sourceType": "script"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json
new file mode 100644
index 000000000000..7da63dd7a987
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 6,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json
index 91d0958e3d0b..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'enum' (1:8)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json
new file mode 100644
index 000000000000..f906a9f99eba
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 6,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json
index be1d10ebd92c..53135cabff8f 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "script",
- "throws": "Unexpected reserved word 'enum' (1:15)"
-}
+ "sourceType": "script"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json
new file mode 100644
index 000000000000..339a9b1d9aef
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 13,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json
index f3a107c75be7..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'enum' (1:15)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json
new file mode 100644
index 000000000000..9ad60d6cf403
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 13,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json
index de270bbb0542..53135cabff8f 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "script",
- "throws": "Unexpected reserved word 'enum' (1:9)"
-}
+ "sourceType": "script"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json
new file mode 100644
index 000000000000..ed7ac1e2953c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json
index 27f9ea278f30..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'enum' (1:9)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json
new file mode 100644
index 000000000000..7a06864215ea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json
index 55bc1ec84f4a..53135cabff8f 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "script",
- "throws": "Unexpected reserved word 'enum' (1:6)"
-}
+ "sourceType": "script"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json
new file mode 100644
index 000000000000..04f287aef702
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json
index e6801417951e..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'enum' (1:6)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json
new file mode 100644
index 000000000000..0619ba17f596
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json
index db72a6af957d..6d24025b8674 100644
--- a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json
@@ -1,4 +1,3 @@
{
- "createParenthesizedExpressions": true,
- "throws": "Invalid left-hand side in arrow function parameters (1:2)"
-}
+ "createParenthesizedExpressions": true
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json
new file mode 100644
index 000000000000..074d84652acc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding member expression (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "elements": [
+ {
+ "type": "MemberExpression",
+ "start": 2,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/options.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/options.json
deleted file mode 100644
index 37d7f62549c6..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (2:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json
new file mode 100644
index 000000000000..a545b4a024b1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json
@@ -0,0 +1,143 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 19,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/options.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/options.json
deleted file mode 100644
index 72f8d0e0e4c3..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json
new file mode 100644
index 000000000000..39554296d4c3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "UnaryExpression",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "operator": "+",
+ "prefix": true,
+ "argument": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/options.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/options.json
deleted file mode 100644
index e55b18eb4f07..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'yield' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json
new file mode 100644
index 000000000000..1a8500a416fb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'yield' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/options.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/options.json
deleted file mode 100644
index 320734ea2ef7..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (2:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json
new file mode 100644
index 000000000000..19d96b67a349
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-class-heritage/options.json b/packages/babel-parser/test/fixtures/es2015/yield/in-class-heritage/options.json
index e817f30acb5c..23c503c046ad 100644
--- a/packages/babel-parser/test/fixtures/es2015/yield/in-class-heritage/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/yield/in-class-heritage/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Unexpected reserved word 'yield' (1:16)"
-}
+ "throws": "Unexpected token, expected \"{\" (1:22)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-iterator-stmt/options.json b/packages/babel-parser/test/fixtures/es2015/yield/in-iterator-stmt/options.json
index ad46a65e5082..589316ba5b14 100644
--- a/packages/babel-parser/test/fixtures/es2015/yield/in-iterator-stmt/options.json
+++ b/packages/babel-parser/test/fixtures/es2015/yield/in-iterator-stmt/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Invalid left-hand side in for-in statement (2:7)"
-}
+ "throws": "Unexpected token, expected \")\" (2:21)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/options.json
deleted file mode 100644
index 75b3f62fdacb..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json
new file mode 100644
index 000000000000..6639d749ab68
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json
@@ -0,0 +1,192 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 20,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 24,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/options.json
deleted file mode 100644
index 9d35f54190c8..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json
new file mode 100644
index 000000000000..b029ca9f0ce9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json
@@ -0,0 +1,331 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 20,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "BinaryExpression",
+ "start": 24,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "left": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3"
+ },
+ "value": 3
+ },
+ "operator": "+",
+ "right": {
+ "type": "BinaryExpression",
+ "start": 28,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "left": {
+ "type": "CallExpression",
+ "start": 28,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "callee": {
+ "type": "MemberExpression",
+ "start": 28,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false
+ },
+ "arguments": [
+ {
+ "type": "YieldExpression",
+ "start": 32,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ ]
+ },
+ "operator": "**",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 48,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/options.json
deleted file mode 100644
index 75b3f62fdacb..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json
new file mode 100644
index 000000000000..7ce61876e0a8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json
@@ -0,0 +1,208 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 24,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "delegate": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 37,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/options.json
deleted file mode 100644
index b3ac060855bb..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json
new file mode 100644
index 000000000000..e88af5b40a30
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json
@@ -0,0 +1,261 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "AssignmentPattern",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3"
+ },
+ "value": 3
+ }
+ },
+ {
+ "type": "AssignmentPattern",
+ "start": 30,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 34,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 44,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/options.json
deleted file mode 100644
index 379c08c57e90..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json
new file mode 100644
index 000000000000..30bb59f8c609
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json
@@ -0,0 +1,230 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:8)",
+ "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 20,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "ArrowFunctionExpression",
+ "start": 24,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "YieldExpression",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 35,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 42,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/options.json
deleted file mode 100644
index 379c08c57e90..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json
new file mode 100644
index 000000000000..ce92441a5734
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json
@@ -0,0 +1,196 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "delegate": false,
+ "argument": null,
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 24
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/options.json
deleted file mode 100644
index 6f5bd40fe357..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "yield is not allowed in generator parameters (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json
new file mode 100644
index 000000000000..a2234a6938db
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json
@@ -0,0 +1,180 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: yield is not allowed in generator parameters (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 3,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "method"
+ },
+ "name": "method"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 11,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/options.json
deleted file mode 100644
index dd9a684ef928..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "yield is not allowed in generator parameters (1:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json
new file mode 100644
index 000000000000..b21c88bc4f9f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json
@@ -0,0 +1,140 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: yield is not allowed in generator parameters (1:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 13,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/options.json
deleted file mode 100644
index ecc179f974cb..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (2:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json
new file mode 100644
index 000000000000..e051b9ac1378
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (2:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 26,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 37,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/options.json
deleted file mode 100644
index b566d4944c2c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json
new file mode 100644
index 000000000000..1bec942c71ac
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:3)",
+ "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "YieldExpression",
+ "start": 20,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 30,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/options.json
deleted file mode 100644
index b566d4944c2c..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json
new file mode 100644
index 000000000000..3c16beba8cdf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json
@@ -0,0 +1,177 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:3)",
+ "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "YieldExpression",
+ "start": 20,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "delegate": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/options.json
deleted file mode 100644
index 479a9a79f900..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (2:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json
new file mode 100644
index 000000000000..18209649f3a6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (2:9)",
+ "SyntaxError: Binding invalid left-hand side in function parameter list (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 19,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ {
+ "type": "YieldExpression",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/options.json
deleted file mode 100644
index 72f8d0e0e4c3..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json
new file mode 100644
index 000000000000..2a15b906e992
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json
@@ -0,0 +1,148 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 3,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "method"
+ },
+ "name": "method"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/options.json
deleted file mode 100644
index dcab4205d32f..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json
new file mode 100644
index 000000000000..a8a1424ee419
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 13,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/options.json
deleted file mode 100644
index 0329a317f084..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'yield' in strict mode (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json
new file mode 100644
index 000000000000..ad17fc3ec47d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'yield' in strict mode (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 21,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 21,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/options.json
deleted file mode 100644
index 75bdf3d53d6e..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (2:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json
new file mode 100644
index 000000000000..ac0ac6a92f89
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (2:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/options.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/options.json
deleted file mode 100644
index dd9a684ef928..000000000000
--- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "yield is not allowed in generator parameters (1:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json
new file mode 100644
index 000000000000..77a0a58b8e3b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json
@@ -0,0 +1,157 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: yield is not allowed in generator parameters (1:17)",
+ "SyntaxError: yield is not allowed in generator parameters (1:24)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 13,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 17,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "delegate": true,
+ "argument": {
+ "type": "YieldExpression",
+ "start": 24,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/options.json
deleted file mode 100644
index 2c624e8cec70..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json
new file mode 100644
index 000000000000..99a1c0eac6e6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "operator": "-",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 5,
+ "raw": "5"
+ },
+ "value": 5
+ }
+ },
+ "operator": "**",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 6,
+ "raw": "6"
+ },
+ "value": 6
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/options.json
deleted file mode 100644
index f04c5c035abb..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json
new file mode 100644
index 000000000000..8bfc60ddbdbc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json
@@ -0,0 +1,128 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "operator": "-",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 5,
+ "raw": "5",
+ "parenthesized": true,
+ "parenStart": 1
+ },
+ "value": 5
+ }
+ },
+ "operator": "**",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 6,
+ "raw": "6"
+ },
+ "value": 6
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/options.json
deleted file mode 100644
index f04c5c035abb..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json
new file mode 100644
index 000000000000..1a7be0b48b55
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json
@@ -0,0 +1,130 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "-",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 5,
+ "raw": "5"
+ },
+ "value": 5
+ }
+ },
+ "operator": "**",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 6,
+ "raw": "6"
+ },
+ "value": 6
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/options.json
index c694133bf2b1..6d24025b8674 100644
--- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/options.json
+++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/options.json
@@ -1,4 +1,3 @@
{
- "createParenthesizedExpressions": true,
- "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)"
-}
+ "createParenthesizedExpressions": true
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json
new file mode 100644
index 000000000000..56e0b17f480e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json
@@ -0,0 +1,141 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "operator": "-",
+ "prefix": true,
+ "argument": {
+ "type": "ParenthesizedExpression",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 5,
+ "raw": "5"
+ },
+ "value": 5
+ }
+ }
+ },
+ "operator": "**",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 6,
+ "raw": "6"
+ },
+ "value": 6
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/options.json
index 19687fbe197a..6d24025b8674 100644
--- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/options.json
+++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/options.json
@@ -1,4 +1,3 @@
{
- "createParenthesizedExpressions": true,
- "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)"
-}
+ "createParenthesizedExpressions": true
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json
new file mode 100644
index 000000000000..5fd8ad0e4fbd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json
@@ -0,0 +1,141 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ParenthesizedExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "-",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 5,
+ "raw": "5"
+ },
+ "value": 5
+ }
+ },
+ "operator": "**",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 6,
+ "raw": "6"
+ },
+ "value": 6
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json
new file mode 100644
index 000000000000..5c66e79b6581
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 11,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "left": {
+ "type": "ArrayPattern",
+ "start": 11,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "option1"
+ },
+ "name": "option1"
+ },
+ {
+ "type": "Identifier",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "option2"
+ },
+ "name": "option2"
+ }
+ ]
+ },
+ "right": {
+ "type": "ArrayExpression",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "elements": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 38,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 42,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json
new file mode 100644
index 000000000000..21f903177a3d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 11,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "option1"
+ },
+ "name": "option1"
+ },
+ {
+ "type": "Identifier",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "option2"
+ },
+ "name": "option2"
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 37,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 37,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/options.json
deleted file mode 100644
index 089b542c3704..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json
new file mode 100644
index 000000000000..c63422a6be79
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "ArrowFunctionExpression",
+ "start": 8,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 9,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "options"
+ },
+ "name": "options"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 30,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 30,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/options.json
deleted file mode 100644
index 089b542c3704..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json
new file mode 100644
index 000000000000..6183a084c384
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "ArrowFunctionExpression",
+ "start": 8,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "options"
+ },
+ "name": "options"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 36,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 36,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json
new file mode 100644
index 000000000000..324b53bc26ec
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json
@@ -0,0 +1,175 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 17,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "options"
+ },
+ "name": "options"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 35,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 35,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json
new file mode 100644
index 000000000000..f40df83751ba
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json
@@ -0,0 +1,175 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 11,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "options"
+ },
+ "name": "options"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 25,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 29,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 29,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json
new file mode 100644
index 000000000000..4d433d4b0bc1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json
@@ -0,0 +1,175 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 12,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "options"
+ },
+ "name": "options"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 30,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 30,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/options.json
deleted file mode 100644
index 9908b496fd2a..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json
new file mode 100644
index 000000000000..393540b1fa01
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json
@@ -0,0 +1,246 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 10,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 14,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "options"
+ },
+ "name": "options"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 28,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 38,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 38,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/options.json
deleted file mode 100644
index 5d0e394f2b9d..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (2:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json
new file mode 100644
index 000000000000..99d18df924f2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json
@@ -0,0 +1,246 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (2:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 10,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 14,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 16,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "options"
+ },
+ "name": "options"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 30,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 36,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 36,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json
new file mode 100644
index 000000000000..f6c0442d811a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json
@@ -0,0 +1,285 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 11,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "left": {
+ "type": "ObjectPattern",
+ "start": 11,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "option1"
+ },
+ "name": "option1"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "option1"
+ },
+ "name": "option1"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "option2"
+ },
+ "name": "option2"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "option2"
+ },
+ "name": "option2"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "properties": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 38,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 42,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json
new file mode 100644
index 000000000000..2089ba375f3e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json
@@ -0,0 +1,254 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 11,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "option1"
+ },
+ "name": "option1"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "option1"
+ },
+ "name": "option1"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "option2"
+ },
+ "name": "option2"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "option2"
+ },
+ "name": "option2"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 37,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 37,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/options.json
deleted file mode 100644
index 12b18792fcc4..000000000000
--- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json
new file mode 100644
index 000000000000..9c23ba0225c7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json
@@ -0,0 +1,159 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "RestElement",
+ "start": 11,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "options"
+ },
+ "name": "options"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 27,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 27,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/2/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/2/options.json
deleted file mode 100644
index c6f19067ee66..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "await* has been removed from the async functions proposal. Use Promise.all() instead. (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json
new file mode 100644
index 000000000000..d6708279fdcb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: await* has been removed from the async functions proposal. Use Promise.all() instead. (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 25,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 25,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "argument": {
+ "type": "CallExpression",
+ "start": 32,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "arguments": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/options.json
deleted file mode 100644
index 022428647fee..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'await' as identifier inside an async function (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json
new file mode 100644
index 000000000000..34fa5d9a8d4f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json
@@ -0,0 +1,109 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'await' as identifier inside an async function (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json
deleted file mode 100644
index c066100759e2..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Await cannot be used as name inside an async function (1:20)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json
new file mode 100644
index 000000000000..c9a8709666e7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json
@@ -0,0 +1,231 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Await cannot be used as name inside an async function (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 7,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "right": {
+ "type": "ArrowFunctionExpression",
+ "start": 11,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 12,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 14,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/options.json
deleted file mode 100644
index d45274982dc1..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'await' as identifier inside an async function (2:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json
new file mode 100644
index 000000000000..3d543c665be5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json
@@ -0,0 +1,143 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'await' as identifier inside an async function (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 25,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 42,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/options.json
deleted file mode 100644
index 9a4cb65743b5..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Await cannot be used as name inside an async function (2:23)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json
new file mode 100644
index 000000000000..281c41288873
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json
@@ -0,0 +1,277 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Await cannot be used as name inside an async function (2:23)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 24,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 24,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 31,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "CallExpression",
+ "start": 35,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "async"
+ },
+ "name": "async"
+ },
+ "arguments": [
+ {
+ "type": "AssignmentExpression",
+ "start": 41,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "right": {
+ "type": "AwaitExpression",
+ "start": 45,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 51,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 58,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/options.json
deleted file mode 100644
index 7cec39290c2a..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Await cannot be used as name inside an async function (2:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json
new file mode 100644
index 000000000000..329e0670c59a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json
@@ -0,0 +1,210 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Await cannot be used as name inside an async function (2:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 24,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 24,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 25,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "AwaitExpression",
+ "start": 29,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 41,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/options.json
deleted file mode 100644
index b45bba7cab4a..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Await cannot be used as name inside an async function (2:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json
new file mode 100644
index 000000000000..39796387c784
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json
@@ -0,0 +1,210 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Await cannot be used as name inside an async function (2:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 24,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 24,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 31,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "AwaitExpression",
+ "start": 35,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 47,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/options.json
deleted file mode 100644
index f4af75f31164..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "await is not allowed in async function parameters (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json
new file mode 100644
index 000000000000..be635254c883
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json
@@ -0,0 +1,158 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: await is not allowed in async function parameters (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 18,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "AwaitExpression",
+ "start": 22,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/options.json
index 9e964f0047f8..1780992b49c5 100644
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/options.json
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Can not use 'await' as identifier inside an async function (1:20)"
-}
+ "throws": "Unexpected token, expected \";\" (1:31)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json
deleted file mode 100644
index 4bcd823e98be..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Async functions can only be declared at the top level or inside a block (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json
new file mode 100644
index 000000000000..e4933140f380
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json
@@ -0,0 +1,125 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Async functions can only be declared at the top level or inside a block (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "WhileStatement",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "test": {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "body": {
+ "type": "FunctionDeclaration",
+ "start": 10,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 30,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/options.json
deleted file mode 100644
index 49a2f478c663..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Constructor can't be an async function (2:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json
new file mode 100644
index 000000000000..8a46002d51c7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Constructor can't be an async function (2:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/options.json
deleted file mode 100644
index bc7331763bfa..000000000000
--- a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected trailing comma after rest element (1:11)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json
new file mode 100644
index 000000000000..009f7252316f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected trailing comma after rest element (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "RestElement",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/options.json
index 6dad74eebd16..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/options.json
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Identifier 'foo' has already been declared (2:23)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json
new file mode 100644
index 000000000000..8e0284f73c05
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json
@@ -0,0 +1,297 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:23)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:23)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 22,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 35,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "RestElement",
+ "start": 42,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 45,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 53,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/options.json
index 165223a448a3..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/options.json
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Identifier 'bar' has already been declared (2:13)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json
new file mode 100644
index 000000000000..dd11a6812a7b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json
@@ -0,0 +1,297 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'bar' has already been declared (2:13)",
+ "SyntaxError: `bar` has already been exported. Exported identifiers must be unique. (2:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 13,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "RestElement",
+ "start": 20,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 36,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 43,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 49,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 55,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/options.json
index 68df28e41c41..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/options.json
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Identifier 'foo' has already been declared (2:30)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json
new file mode 100644
index 000000000000..a591bf90155e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json
@@ -0,0 +1,349 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:30)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:30)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 22,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 35,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 37,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ObjectPattern",
+ "start": 42,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "RestElement",
+ "start": 49,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 52,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 40
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ },
+ "identifierName": "qux"
+ },
+ "name": "qux"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/options.json
index 280073b140f0..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/options.json
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Identifier 'foo' has already been declared (2:29)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json
new file mode 100644
index 000000000000..d092e82a47c3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json
@@ -0,0 +1,331 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:29)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:29)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 22,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 35,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ {
+ "type": "ObjectPattern",
+ "start": 41,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "RestElement",
+ "start": 48,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 51,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 60,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ },
+ "identifierName": "qux"
+ },
+ "name": "qux"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/options.json
index 68df28e41c41..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/options.json
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Identifier 'foo' has already been declared (2:30)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json
new file mode 100644
index 000000000000..a35595b31013
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json
@@ -0,0 +1,348 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'foo' has already been declared (2:30)",
+ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:30)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 22,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 35,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 35,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ {
+ "type": "ArrayPattern",
+ "start": 41,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 42,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "RestElement",
+ "start": 49,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 52,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 40
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ },
+ "identifierName": "qux"
+ },
+ "name": "qux"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/options.json
deleted file mode 100644
index b447c590ab2c..000000000000
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid rest operator's argument (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json
new file mode 100644
index 000000000000..9a9ef9274914
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid rest operator's argument (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 1,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "properties": [
+ {
+ "type": "RestElement",
+ "start": 2,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "argument": {
+ "type": "ObjectPattern",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "properties": []
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "properties": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/options.json
deleted file mode 100644
index b447c590ab2c..000000000000
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid rest operator's argument (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json
new file mode 100644
index 000000000000..09b6d303c4ac
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json
@@ -0,0 +1,173 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid rest operator's argument (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 1,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "properties": [
+ {
+ "type": "RestElement",
+ "start": 2,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "argument": {
+ "type": "AssignmentPattern",
+ "start": 5,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "properties": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/options.json
deleted file mode 100644
index b447c590ab2c..000000000000
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid rest operator's argument (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json
new file mode 100644
index 000000000000..2f80e2925775
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid rest operator's argument (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 1,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "properties": [
+ {
+ "type": "RestElement",
+ "start": 2,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "argument": {
+ "type": "ArrayPattern",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "elements": []
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "properties": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/options.json
deleted file mode 100644
index c44d69275adb..000000000000
--- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected trailing comma after rest element (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json
new file mode 100644
index 000000000000..c7ff07e0d0df
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json
@@ -0,0 +1,250 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected trailing comma after rest element (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 4,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ },
+ {
+ "type": "RestElement",
+ "start": 12,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "z"
+ },
+ "name": "z"
+ }
+ }
+ ],
+ "extra": {
+ "trailingComma": 16
+ }
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/options.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/options.json
deleted file mode 100644
index 8b20b9a7df36..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json
new file mode 100644
index 000000000000..aa4301697cf8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json
deleted file mode 100644
index a4a6e207d28c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json
new file mode 100644
index 000000000000..09552b591b3f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json
@@ -0,0 +1,193 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "ArrayPattern",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ ]
+ },
+ {
+ "type": "RestElement",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/options.json
deleted file mode 100644
index 49e8d8e86314..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (2:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json
new file mode 100644
index 000000000000..57442d5cb4fd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (2:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/options.json
deleted file mode 100644
index 3829082a4878..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (2:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json
new file mode 100644
index 000000000000..4242da8e09f7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json
@@ -0,0 +1,193 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (2:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 25,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "RestElement",
+ "start": 28,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/options.json
deleted file mode 100644
index 782073313a19..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (2:19)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json
new file mode 100644
index 000000000000..00b0c28f58c6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json
@@ -0,0 +1,248 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (2:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 25,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 26,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": true,
+ "value": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "extra": {
+ "shorthand": true
+ }
+ }
+ ]
+ },
+ {
+ "type": "RestElement",
+ "start": 30,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json
deleted file mode 100644
index fd74c5228531..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json
new file mode 100644
index 000000000000..34fec649661b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json
@@ -0,0 +1,159 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "RestElement",
+ "start": 3,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "argument": {
+ "type": "ArrayPattern",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ]
+ }
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json
deleted file mode 100644
index 368006ae58bd..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json
new file mode 100644
index 000000000000..5456b40fe86d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json
@@ -0,0 +1,124 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json
deleted file mode 100644
index 8f5ca9d5da67..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json
new file mode 100644
index 000000000000..1daa964b52b1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json
@@ -0,0 +1,143 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 8,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 9,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 9,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/options.json
deleted file mode 100644
index bf0f292caad2..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in object destructuring pattern (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json
new file mode 100644
index 000000000000..9e8858777646
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json
@@ -0,0 +1,198 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding member expression (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 2,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "MemberExpression",
+ "start": 4,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "property": {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ "computed": true
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/options.json
deleted file mode 100644
index 559cc4e11a41..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Object pattern can't contain getter or setter (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json
new file mode 100644
index 000000000000..d391e09c2dfe
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Object pattern can't contain getter or setter (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 2,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "kind": "get",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/options.json
deleted file mode 100644
index 30f209db8f07..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in object destructuring pattern (1:24)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json
new file mode 100644
index 000000000000..a0f4f6168da6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json
@@ -0,0 +1,538 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding member expression (1:24)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 1,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 2,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 3,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 4,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 5,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 6,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 7,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 8,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 9,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 10,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 11,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 12,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 13,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 15,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 16,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 17,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 18,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "elements": [
+ {
+ "type": "ArrayPattern",
+ "start": 20,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "elements": [
+ {
+ "type": "ObjectPattern",
+ "start": 21,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 22,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "MemberExpression",
+ "start": 24,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "property": {
+ "type": "NumericLiteral",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ "computed": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 52,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 52
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json
deleted file mode 100644
index bf0f292caad2..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in object destructuring pattern (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json
new file mode 100644
index 000000000000..b71ec1a70153
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 1,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 2,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ThisExpression",
+ "start": 4,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json
deleted file mode 100644
index 2cfe61cdc033..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in object destructuring pattern (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json
new file mode 100644
index 000000000000..0282d2b2a59c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in object destructuring pattern (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 1,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 2,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "ThisExpression",
+ "start": 5,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/input.js b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/input.js
index 1dcb7ce683e6..dd21753e3550 100644
--- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/input.js
@@ -1 +1 @@
-({a(){}})=0
+({a(){}}=0)
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json
deleted file mode 100644
index 081535f854c6..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Object pattern can't contain methods (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json
new file mode 100644
index 000000000000..4f63aa8f3c12
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Object pattern can't contain methods (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 1,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ObjectPattern",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 2,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json
deleted file mode 100644
index 7c5f08eb9ba6..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json
new file mode 100644
index 000000000000..a6616604e7dd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "SequenceExpression",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expressions": [
+ {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 3,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "right": {
+ "type": "SequenceExpression",
+ "start": 7,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expressions": [
+ {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ },
+ {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "d"
+ },
+ "name": "d"
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 6
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json
index 9371e19769ce..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected keyword 'default' (1:8)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json
new file mode 100644
index 000000000000..0b3a95c25658
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json
@@ -0,0 +1,107 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'default' (1:8)",
+ "SyntaxError: Export 'default' is not defined (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ExportSpecifier",
+ "start": 8,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ },
+ "exported": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "default"
+ },
+ "name": "default"
+ }
+ }
+ ],
+ "source": null,
+ "declaration": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json
deleted file mode 100644
index 1fc5db8949ff..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-of loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json
new file mode 100644
index 000000000000..9addc13c958b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json
@@ -0,0 +1,156 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "await": false,
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json
deleted file mode 100644
index 1fc5db8949ff..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-of loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json
new file mode 100644
index 000000000000..e7720b34974c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json
@@ -0,0 +1,156 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "await": false,
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json
deleted file mode 100644
index a4dd545935e8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-of statement (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json
new file mode 100644
index 000000000000..bdb80af26d26
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json
@@ -0,0 +1,101 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-of statement (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "await": false,
+ "left": {
+ "type": "ThisExpression",
+ "start": 5,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "that"
+ },
+ "name": "that"
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json
deleted file mode 100644
index 1fc5db8949ff..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-of loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json
new file mode 100644
index 000000000000..5c95e7b34186
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json
@@ -0,0 +1,156 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "await": false,
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json
deleted file mode 100644
index df97a8ee679f..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json
new file mode 100644
index 000000000000..111d8eb97b43
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:4)",
+ "SyntaxError: Invalid Unicode escape (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "𞸀"
+ },
+ "name": "𞸀"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json
deleted file mode 100644
index afbed324e92a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json
new file mode 100644
index 000000000000..a6d558c93efe
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json
@@ -0,0 +1,158 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 11,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "answer"
+ },
+ "name": "answer"
+ },
+ "init": {
+ "type": "BinaryExpression",
+ "start": 20,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json
deleted file mode 100644
index afbed324e92a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json
new file mode 100644
index 000000000000..514e8e0f0abe
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "specifiers": [],
+ "source": null,
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 7,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "await"
+ },
+ "name": "await"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json
deleted file mode 100644
index 57893e4eee56..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Complex binding patterns require an initialization value (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json
new file mode 100644
index 000000000000..fe814362c2c8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json
@@ -0,0 +1,88 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Complex binding patterns require an initialization value (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 4,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "elements": []
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json
deleted file mode 100644
index 68677faac9b9..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-in loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json
new file mode 100644
index 000000000000..f2fe5561bb8d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json
@@ -0,0 +1,157 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json
deleted file mode 100644
index 68677faac9b9..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "for-in loop variable declaration may not have an initializer (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json
new file mode 100644
index 000000000000..3a3a8f1230c5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json
@@ -0,0 +1,157 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 5,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json
deleted file mode 100644
index a8a536e737f3..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "new.target can only be used in functions (1:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json
new file mode 100644
index 000000000000..e02e90a31d33
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: new.target can only be used in functions (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "MetaProperty",
+ "start": 8,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "new"
+ },
+ "name": "new"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "target"
+ },
+ "name": "target"
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json
deleted file mode 100644
index f1d291c3e468..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The only valid meta property for new is new.target (1:25)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json
new file mode 100644
index 000000000000..4bcbca3b0d36
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "errors": [
+ "SyntaxError: The only valid meta property for new is new.target (1:25)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "init": {
+ "type": "FunctionExpression",
+ "start": 8,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 21,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "MetaProperty",
+ "start": 21,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "new"
+ },
+ "name": "new"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "unknown_property"
+ },
+ "name": "unknown_property"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json
deleted file mode 100644
index de857a114a82..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:39)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json
new file mode 100644
index 000000000000..8316c5f97f85
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json
@@ -0,0 +1,234 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:39)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 3,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "__proto"
+ },
+ "name": "__proto"
+ },
+ "computed": false,
+ "kind": "get",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 20,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "extra": {
+ "rawValue": "__proto__",
+ "raw": "\"__proto__\""
+ },
+ "value": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 33,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 39,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 50,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 50
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ }
+ }
+ }
+ ],
+ "extra": {
+ "trailingComma": 54,
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json
deleted file mode 100644
index 5c966843f4fa..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json
new file mode 100644
index 000000000000..5e3da9129e41
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json
@@ -0,0 +1,177 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 3,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 20,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "extra": {
+ "rawValue": "__proto__",
+ "raw": "\"__proto__\""
+ },
+ "value": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 33,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json
deleted file mode 100644
index 5c966843f4fa..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json
new file mode 100644
index 000000000000..f0884a922d47
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json
@@ -0,0 +1,174 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 3,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 20,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 31,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json
deleted file mode 100644
index e19950ad14df..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json
new file mode 100644
index 000000000000..7b8c0af8927c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json
@@ -0,0 +1,177 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 3,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 3,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": "__proto__",
+ "raw": "\"__proto__\""
+ },
+ "value": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 16,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 22,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 33,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json
deleted file mode 100644
index e19950ad14df..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json
new file mode 100644
index 000000000000..a9e0e52b80af
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json
@@ -0,0 +1,180 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 3,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 3,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": "__proto__",
+ "raw": "\"__proto__\""
+ },
+ "value": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 16,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 22,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 22,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "extra": {
+ "rawValue": "__proto__",
+ "raw": "'__proto__'"
+ },
+ "value": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 35,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json
deleted file mode 100644
index f364ee918462..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:42)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json
new file mode 100644
index 000000000000..1a77efa6deef
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json
@@ -0,0 +1,252 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:42)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 60
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 3,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "kind": "set",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 23,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 23,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "extra": {
+ "rawValue": "__proto__",
+ "raw": "\"__proto__\""
+ },
+ "value": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 36,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ }
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 42,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NullLiteral",
+ "start": 53,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ }
+ }
+ }
+ ],
+ "extra": {
+ "trailingComma": 57,
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json
deleted file mode 100644
index cf468e48541b..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "super is only allowed in object methods and classes (1:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json
new file mode 100644
index 000000000000..94b7917cd389
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 8,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "callee": {
+ "type": "Super",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json
new file mode 100644
index 000000000000..3f3cd6596907
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "value": {
+ "raw": "\\1",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json
deleted file mode 100644
index f81e206da65d..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (1:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json
new file mode 100644
index 000000000000..93f29667086b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json
@@ -0,0 +1,211 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (1:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 16,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 16,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 17,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 21,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "delegate": false,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json
deleted file mode 100644
index efa8ac523c48..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json
new file mode 100644
index 000000000000..dfdc04d3c48b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (1:16)",
+ "SyntaxError: Binding invalid left-hand side in function parameter list (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "YieldExpression",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json
deleted file mode 100644
index 185008241333..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (1:25)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json
new file mode 100644
index 000000000000..6bf7ee0d6108
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json
@@ -0,0 +1,215 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (1:25)",
+ "SyntaxError: Binding invalid left-hand side in function parameter list (1:25)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 15,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 15,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ },
+ {
+ "type": "YieldExpression",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 35,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json
deleted file mode 100644
index 8c287a1d5b36..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:30)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json
new file mode 100644
index 000000000000..638788f4405b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json
@@ -0,0 +1,173 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:30)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 16,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 23,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 37,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json
deleted file mode 100644
index 3ceff8546d37..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:26)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json
new file mode 100644
index 000000000000..30846cf74293
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json
@@ -0,0 +1,143 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:26)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 16,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json
index 23a96f285fe4..54925950e059 100644
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Unexpected reserved word 'yield' (1:25)"
-}
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json
new file mode 100644
index 000000000000..273c4fcdf066
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json
@@ -0,0 +1,105 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:25)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "start": 15,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json
deleted file mode 100644
index c32eaf81f281..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json
new file mode 100644
index 000000000000..0eca9154c92a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json
@@ -0,0 +1,109 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json
deleted file mode 100644
index 28b734910647..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json
new file mode 100644
index 000000000000..dbee42bd9873
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json
@@ -0,0 +1,111 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json
deleted file mode 100644
index aef4d7f4f9a2..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json
new file mode 100644
index 000000000000..74eaaceb9832
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json
@@ -0,0 +1,143 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ {
+ "type": "RestElement",
+ "start": 15,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json
deleted file mode 100644
index 6993832643f1..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:25)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json
new file mode 100644
index 000000000000..ec55ac771815
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json
@@ -0,0 +1,143 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:25)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 16,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json
deleted file mode 100644
index ad818f81f136..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json
new file mode 100644
index 000000000000..e07b84fedd4d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json
@@ -0,0 +1,142 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 16,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 20,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json
deleted file mode 100644
index 28b734910647..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json
new file mode 100644
index 000000000000..91b76a6f9351
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json
deleted file mode 100644
index c811689d9abd..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:24)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json
new file mode 100644
index 000000000000..0b1e59c7ab58
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json
@@ -0,0 +1,174 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:24)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ },
+ {
+ "type": "RestElement",
+ "start": 21,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 30,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json
deleted file mode 100644
index 865e081676d6..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:46)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json
new file mode 100644
index 000000000000..b1b8b4f0880d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json
@@ -0,0 +1,229 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:46)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 29,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 33,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "init": {
+ "type": "FunctionExpression",
+ "start": 37,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 46,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 46
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 53,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json
deleted file mode 100644
index 21348af52377..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:47)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json
new file mode 100644
index 000000000000..40d206249a26
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json
@@ -0,0 +1,231 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:47)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 28,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 30,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 34,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ },
+ "identifierName": "z"
+ },
+ "name": "z"
+ },
+ "init": {
+ "type": "FunctionExpression",
+ "start": 38,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 47,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json
deleted file mode 100644
index ad818f81f136..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Can not use 'yield' as identifier inside a generator (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json
new file mode 100644
index 000000000000..770c2246fabb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json
@@ -0,0 +1,142 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 16,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 20,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json
deleted file mode 100644
index e817f30acb5c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json
new file mode 100644
index 000000000000..4a0cd5664566
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json
@@ -0,0 +1,160 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 15,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "ArrayPattern",
+ "start": 15,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ]
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 14
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json
deleted file mode 100644
index e80b46c31b86..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:19)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json
new file mode 100644
index 000000000000..b6b507c9e6cb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json
@@ -0,0 +1,175 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json
deleted file mode 100644
index 27b38d28f986..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json
new file mode 100644
index 000000000000..3c5b82bd6c7b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json
deleted file mode 100644
index 5d111aab9319..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:23)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json
new file mode 100644
index 000000000000..06d787bb4992
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json
@@ -0,0 +1,193 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:23)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 18,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "ObjectPattern",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 20,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ }
+ ]
+ },
+ "init": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json
deleted file mode 100644
index 01aca4591cea..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:28)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json
new file mode 100644
index 000000000000..2b7952b2afe7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json
@@ -0,0 +1,156 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:28)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 14,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 21,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 35,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json
deleted file mode 100644
index a4a677fb3136..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:25)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json
new file mode 100644
index 000000000000..f936dc48abf9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:25)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json
deleted file mode 100644
index e55b18eb4f07..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'yield' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json
new file mode 100644
index 000000000000..7f270919a446
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'yield' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json
deleted file mode 100644
index 8928b8977517..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'yield' in strict mode (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json
new file mode 100644
index 000000000000..d65f41baceea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json
@@ -0,0 +1,145 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'yield' in strict mode (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json
deleted file mode 100644
index 412431249548..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:29)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json
new file mode 100644
index 000000000000..0d4e30957667
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json
@@ -0,0 +1,159 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:29)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json
deleted file mode 100644
index 53a8921cb309..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json
new file mode 100644
index 000000000000..71c86eec827d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 18,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json
deleted file mode 100644
index 01aca4591cea..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:28)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json
new file mode 100644
index 000000000000..d246bfc86e6e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json
@@ -0,0 +1,159 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:28)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "RestElement",
+ "start": 25,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 35,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json
deleted file mode 100644
index 53a8921cb309..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json
new file mode 100644
index 000000000000..0561e522bd7b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json
@@ -0,0 +1,125 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 14,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/options.json
deleted file mode 100644
index f81e206da65d..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Yield cannot be used as name inside a generator function (1:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json
new file mode 100644
index 000000000000..c26b779c0207
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json
@@ -0,0 +1,192 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Yield cannot be used as name inside a generator function (1:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ },
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 16,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 16,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 17,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "YieldExpression",
+ "start": 21,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "delegate": false,
+ "argument": null
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/input.js b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/input.js
index 79581f8529b7..cbd842119b94 100755
--- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/input.js
@@ -1 +1 @@
-\u2163\u2161\u200A=\u2009[]
+\u2163\u2161\u200A
diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/options.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/options.json
deleted file mode 100644
index abe9f835b84b..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json
new file mode 100644
index 000000000000..ea30bc6a3013
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "ⅣⅡ "
+ },
+ "name": "ⅣⅡ "
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json
deleted file mode 100644
index 8e0dce66eff8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json
new file mode 100644
index 000000000000..30ad8a2a0533
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": "\\x",
+ "extra": {
+ "raw": "\"\\x\"",
+ "rawValue": "\\x"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json
deleted file mode 100644
index 8e0dce66eff8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json
new file mode 100644
index 000000000000..91bb0ab97d98
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": "\\x0",
+ "extra": {
+ "raw": "\"\\x0\"",
+ "rawValue": "\\x0"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json
deleted file mode 100644
index 8e0dce66eff8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json
new file mode 100644
index 000000000000..422caf2f1ecf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": "\\xx",
+ "extra": {
+ "raw": "\"\\xx\"",
+ "rawValue": "\\xx"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json
deleted file mode 100644
index 8e0dce66eff8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json
new file mode 100644
index 000000000000..a00ba8fc772c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": "\\u",
+ "extra": {
+ "raw": "\"\\u\"",
+ "rawValue": "\\u"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json
deleted file mode 100644
index 8e0dce66eff8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json
new file mode 100644
index 000000000000..4158fada8f7f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": "\\u0",
+ "extra": {
+ "raw": "\"\\u0\"",
+ "rawValue": "\\u0"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json
deleted file mode 100644
index 8e0dce66eff8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json
new file mode 100644
index 000000000000..b36764ece66c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": "\\ux",
+ "extra": {
+ "raw": "\"\\ux\"",
+ "rawValue": "\\ux"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json
deleted file mode 100644
index 8e0dce66eff8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json
new file mode 100644
index 000000000000..b24d044db414
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "\\u00",
+ "extra": {
+ "raw": "\"\\u00\"",
+ "rawValue": "\\u00"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json
deleted file mode 100644
index 8e0dce66eff8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Bad character escape sequence (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json
new file mode 100644
index 000000000000..eb3f631398dc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "\\u000",
+ "extra": {
+ "raw": "\"\\u000\"",
+ "rawValue": "\\u000"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json
index 91bb1eef0c0d..aa61ff56c2b3 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Invalid number (1:0)"
-}
+ "throws": "Identifier directly after number (1:2)"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json
deleted file mode 100644
index 91bb1eef0c0d..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid number (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json
new file mode 100644
index 000000000000..284fac8c4357
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid number (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3e"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json
deleted file mode 100644
index 91bb1eef0c0d..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid number (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json
new file mode 100644
index 000000000000..6b6e666b00ca
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid number (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3e+"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json
deleted file mode 100644
index 91bb1eef0c0d..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid number (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json
new file mode 100644
index 000000000000..b52b27d1ef37
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid number (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3e-"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json
deleted file mode 100644
index 1a0693338eee..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 16 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json
new file mode 100644
index 000000000000..ffcb3680fd0b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 16 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0x"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json
deleted file mode 100644
index 3f09c36a5f1c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 8 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json
new file mode 100644
index 000000000000..12a024fb2c03
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0o"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json
deleted file mode 100644
index 3f09c36a5f1c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 8 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json
new file mode 100644
index 000000000000..5d2ed2d91388
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0O"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json
deleted file mode 100644
index 3f09c36a5f1c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 8 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json
new file mode 100644
index 000000000000..4b91f320f950
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0o9"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json
new file mode 100644
index 000000000000..9978c5342ef3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 8,
+ "raw": "0o18"
+ },
+ "value": 8
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json
deleted file mode 100644
index 40dc3da9a8f4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 2 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json
new file mode 100644
index 000000000000..0688a297c669
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0b"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json
deleted file mode 100644
index 40dc3da9a8f4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 2 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json
new file mode 100644
index 000000000000..7281fb745a17
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0b9"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json
new file mode 100644
index 000000000000..25d711669b8b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "0b18"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json
new file mode 100644
index 000000000000..379e9db894c0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "0b12"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json
deleted file mode 100644
index 40dc3da9a8f4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 2 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json
new file mode 100644
index 000000000000..c87719ade97e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": null,
+ "raw": "0B"
+ },
+ "value": null
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json
deleted file mode 100644
index 40dc3da9a8f4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 2 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json
new file mode 100644
index 000000000000..e82ab6ace61a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0B9"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json
new file mode 100644
index 000000000000..3726afdc10d4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "0B18"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json
new file mode 100644
index 000000000000..402fcffc9e54
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "0B12"
+ },
+ "value": 2
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json
deleted file mode 100644
index 3f09c36a5f1c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected number in radix 8 (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json
new file mode 100644
index 000000000000..af4105738ef8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0O9"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json
deleted file mode 100644
index d52d9cfac4bc..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json
new file mode 100644
index 000000000000..617cc13b6615
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 8 (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 8,
+ "raw": "0O18"
+ },
+ "value": 8
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json
deleted file mode 100644
index 18c53b997b56..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json
new file mode 100644
index 000000000000..fbb1d3b5d554
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "xx\\"
+ },
+ "name": "xx\\"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/input.js
index fff580f2044f..0d9e932087f0 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/input.js
@@ -1 +1 @@
-x\\u005c
+x\u005c
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json
deleted file mode 100644
index 18c53b997b56..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json
new file mode 100644
index 000000000000..fae32b78cde4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "x\\"
+ },
+ "name": "x\\"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/input.js
index 17112246786b..2999f29197cd 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/input.js
@@ -1 +1 @@
-x\\u002a
+x\u002a
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json
deleted file mode 100644
index 18c53b997b56..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json
new file mode 100644
index 000000000000..37312f42ce97
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "x*"
+ },
+ "name": "x*"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/input.js
index 3177052a225a..9cfc5e1cb357 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/input.js
@@ -1 +1 @@
-a\\u
+a\u
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json
deleted file mode 100644
index 18c53b997b56..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json
new file mode 100644
index 000000000000..3fa5e0bfd57d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/input.js
index d56d7c190d02..fa959cc0ecce 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/input.js
@@ -1 +1 @@
-\\ua
+\ua
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json
new file mode 100644
index 000000000000..be5c03381dd1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": ""
+ },
+ "name": ""
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/input.js
index 9a2dc1767685..7f54fa707500 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/input.js
@@ -1 +1 @@
-var x = /[a-z]/\\ux
+var x = /[a-z]/\ux
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json
deleted file mode 100644
index adf556b0a352..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid regular expression flag (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json
new file mode 100644
index 000000000000..68d637a98170
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json
@@ -0,0 +1,109 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid regular expression flag (1:16)",
+ "SyntaxError: Invalid regular expression flag (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "RegExpLiteral",
+ "start": 8,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "extra": {
+ "raw": "/[a-z]/\\ux"
+ },
+ "pattern": "[a-z]",
+ "flags": "\\ux"
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/input.js
index fdbf86f1d023..e8f66bb867d1 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/input.js
@@ -1 +1 @@
-var x = /[a-z\n]/\\ux
+var x = /[a-z\n]/\ux
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json
deleted file mode 100644
index eae3757f4451..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid regular expression flag (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json
new file mode 100644
index 000000000000..c4e889cefe20
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json
@@ -0,0 +1,109 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid regular expression flag (1:18)",
+ "SyntaxError: Invalid regular expression flag (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "RegExpLiteral",
+ "start": 8,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "raw": "/[a-z\\n]/\\ux"
+ },
+ "pattern": "[a-z\\n]",
+ "flags": "\\ux"
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/input.js
index e2a2d371e229..9a2dc1767685 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/input.js
@@ -1 +1 @@
-var x = /[a-z]/\\\\ux
+var x = /[a-z]/\\ux
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json
deleted file mode 100644
index adf556b0a352..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid regular expression flag (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json
new file mode 100644
index 000000000000..76ef6d90fe84
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid regular expression flag (1:16)",
+ "SyntaxError: Invalid regular expression flag (1:17)",
+ "SyntaxError: Invalid regular expression flag (1:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "RegExpLiteral",
+ "start": 8,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "extra": {
+ "raw": "/[a-z]/\\\\ux"
+ },
+ "pattern": "[a-z]",
+ "flags": "\\\\ux"
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/input.js
index fc48dffd74dc..405b48568aa8 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/input.js
@@ -1 +1 @@
-var x = /[P QR]/\\\\u0067
+var x = /[P QR]/\\u0067
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json
deleted file mode 100644
index 080cb0eaaa8a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid regular expression flag (1:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json
new file mode 100644
index 000000000000..430d18e24eac
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json
@@ -0,0 +1,113 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid regular expression flag (1:17)",
+ "SyntaxError: Invalid regular expression flag (1:18)",
+ "SyntaxError: Invalid regular expression flag (1:20)",
+ "SyntaxError: Invalid regular expression flag (1:21)",
+ "SyntaxError: Invalid regular expression flag (1:22)",
+ "SyntaxError: Invalid regular expression flag (1:23)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "RegExpLiteral",
+ "start": 8,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "extra": {
+ "raw": "/[P QR]/\\\\u0067"
+ },
+ "pattern": "[P QR]",
+ "flags": "\\\\u0067"
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json
new file mode 100644
index 000000000000..99a3e74a04af
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json
@@ -0,0 +1,109 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3"
+ },
+ "value": 3
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 4,
+ "raw": "4"
+ },
+ "value": 4
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json
new file mode 100644
index 000000000000..8770df4abba7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "func"
+ },
+ "name": "func"
+ },
+ "arguments": []
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 4,
+ "raw": "4"
+ },
+ "value": 4
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json
deleted file mode 100644
index 7c5f08eb9ba6..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json
new file mode 100644
index 000000000000..42614106f157
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json
@@ -0,0 +1,149 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "BinaryExpression",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "left": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/input.js
index 2bbf7ac4d47c..1d1226dada02 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/input.js
@@ -1 +1 @@
-\\u{110000}
+\u{110000}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json
index 381fd12ce2d0..8dfd231d943b 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
+ "throws": "Invalid code point 1114112"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/input.js
index 9943cc7906a5..aabe8d74272e 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/input.js
@@ -1 +1 @@
-\\u{}
+\u{}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json
new file mode 100644
index 000000000000..9d206b4f8475
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": ""
+ },
+ "name": ""
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/input.js
index 5d4f24cb8271..170edba55da6 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/input.js
@@ -1 +1 @@
-\\u{FFFF
+\u{FFFF
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json
new file mode 100644
index 000000000000..252665de0e5e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "FFF"
+ },
+ "name": "FFF"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/input.js
index 11e05c81c1e8..0c65088d077b 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/input.js
@@ -1 +1 @@
-\\u{FFZ}
+\u{FFZ}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json
new file mode 100644
index 000000000000..2c27554ffa56
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Bad character escape sequence (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": ""
+ },
+ "name": ""
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json
deleted file mode 100644
index c09dac1301de..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in postfix operation (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json
new file mode 100644
index 000000000000..ce2cb3d23d67
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in postfix operation (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "++",
+ "prefix": false,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json
deleted file mode 100644
index c09dac1301de..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in postfix operation (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json
new file mode 100644
index 000000000000..57d55fec0b5d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in postfix operation (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "--",
+ "prefix": false,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json
deleted file mode 100644
index 515e441e8ea7..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in prefix operation (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json
new file mode 100644
index 000000000000..9a7a240c5b4a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in prefix operation (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "++",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json
deleted file mode 100644
index 515e441e8ea7..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in prefix operation (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json
new file mode 100644
index 000000000000..85107220dae5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in prefix operation (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "operator": "--",
+ "prefix": true,
+ "argument": {
+ "type": "NumericLiteral",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json
deleted file mode 100644
index f8560a7de9d6..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-in statement (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json
new file mode 100644
index 000000000000..f9e5df01e76a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json
@@ -0,0 +1,196 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-in statement (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "left": {
+ "type": "BinaryExpression",
+ "start": 5,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "left": {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 4
+ }
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "list"
+ },
+ "name": "list"
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 21,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 21,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ },
+ "identifierName": "process"
+ },
+ "name": "process"
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "start": 29,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json
deleted file mode 100644
index 2b91be8d5115..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected keyword 'if' (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json
new file mode 100644
index 000000000000..ac910291b748
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'if' (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "if"
+ },
+ "name": "if"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json
new file mode 100644
index 000000000000..56547ff7be13
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json
@@ -0,0 +1,142 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json
deleted file mode 100644
index 6010e96ed144..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in assignment expression (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json
new file mode 100644
index 000000000000..ece139488ea0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json
@@ -0,0 +1,123 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "UnaryExpression",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "operator": "+",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ }
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json
index aa55ec4f840f..5a02a61446d2 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json
@@ -1,3 +1,5 @@
{
- "throws": "setter must have exactly one formal parameter (1:3)"
-}
+ "plugins": [
+ "estree"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json
new file mode 100644
index 000000000000..b0ad15758245
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json
@@ -0,0 +1,145 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: setter must have exactly one formal parameter (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 1,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "properties": [
+ {
+ "type": "Property",
+ "start": 3,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "kind": "set",
+ "value": {
+ "type": "FunctionExpression",
+ "start": 8,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "expression": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "body": []
+ }
+ },
+ "shorthand": false
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json
deleted file mode 100644
index 92845f5f2081..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json
new file mode 100644
index 000000000000..3731ec6d7b75
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json
@@ -0,0 +1,182 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:15)",
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json
deleted file mode 100644
index ad54c428a2f9..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json
new file mode 100644
index 000000000000..dbffe6547ab5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json
deleted file mode 100644
index bfa08eae293e..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json
new file mode 100644
index 000000000000..1b3ed15f002e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json
deleted file mode 100644
index 794c4864d4e5..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json
new file mode 100644
index 000000000000..6b7ae83c0ad2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json
deleted file mode 100644
index 212d35fcb5fe..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json
new file mode 100644
index 000000000000..c681755fb108
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json
deleted file mode 100644
index 368006ae58bd..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json
new file mode 100644
index 000000000000..78da40f6d8c7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json
@@ -0,0 +1,127 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json
deleted file mode 100644
index b99fd35222b1..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json
new file mode 100644
index 000000000000..3a5f60bdddea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json
deleted file mode 100644
index 79a05e62290e..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (1:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json
new file mode 100644
index 000000000000..18c0889f74b8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "00"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json
deleted file mode 100644
index 99ffc0de0153..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json
new file mode 100644
index 000000000000..a7c444dfbcdc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json
@@ -0,0 +1,113 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "00"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json
deleted file mode 100644
index 99ffc0de0153..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json
new file mode 100644
index 000000000000..2d80f047d283
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)",
+ "SyntaxError: Binding invalid left-hand side in function parameter list (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 20,
+ "raw": "20"
+ },
+ "value": 20
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "00"
+ },
+ "value": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json
deleted file mode 100644
index 794c4864d4e5..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json
new file mode 100644
index 000000000000..49e0835c1bfc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "NumericLiteral",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json
deleted file mode 100644
index cc2bef2a9a34..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json
new file mode 100644
index 000000000000..85866aeddd23
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 10,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 12,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 12,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json
deleted file mode 100644
index 701f9fe8f27a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json
new file mode 100644
index 000000000000..d3a105c584dd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json
deleted file mode 100644
index de66853a7a3d..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json
new file mode 100644
index 000000000000..c32c5b089115
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json
deleted file mode 100644
index f8560a7de9d6..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-in statement (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json
new file mode 100644
index 000000000000..3844a4d151a7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-in statement (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "left": {
+ "type": "BinaryExpression",
+ "start": 5,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json
deleted file mode 100644
index f8560a7de9d6..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in for-in statement (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json
new file mode 100644
index 000000000000..9d008175f644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json
@@ -0,0 +1,118 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in for-in statement (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "operator": "+",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ }
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json
deleted file mode 100644
index 429d96ca3f9a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Missing catch or finally clause (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json
new file mode 100644
index 000000000000..3d2ee0555b85
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json
@@ -0,0 +1,72 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Missing catch or finally clause (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": null,
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json
deleted file mode 100644
index 82bcfe621c49..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json
new file mode 100644
index 000000000000..237da8c03a78
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "‿"
+ },
+ "name": "‿"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json
deleted file mode 100644
index 97818d2eea7e..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Lexical declaration cannot appear in a single-statement context (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json
new file mode 100644
index 000000000000..c273b86361e0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json
@@ -0,0 +1,140 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "IfStatement",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 3,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": true
+ },
+ "consequent": {
+ "type": "VariableDeclaration",
+ "start": 9,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ "alternate": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json
deleted file mode 100644
index aadfa63716c2..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Multiple default clauses (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json
new file mode 100644
index 000000000000..c90c4eefdc6f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Multiple default clauses (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "SwitchStatement",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "discriminant": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ },
+ "cases": [
+ {
+ "type": "SwitchCase",
+ "start": 13,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "consequent": [],
+ "test": null
+ },
+ {
+ "type": "SwitchCase",
+ "start": 22,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "consequent": [],
+ "test": null
+ }
+ ]
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/input.js
index adcf3cef4357..57ddad2aec5d 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/input.js
@@ -1 +1 @@
-\\
+\
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json
new file mode 100644
index 000000000000..8644ccf99c0e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "\\"
+ },
+ "name": "\\"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/input.js
index b9e12b2eff54..65bd7cf67b3f 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/input.js
@@ -1 +1 @@
-\\u005c
+\u005c
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json
new file mode 100644
index 000000000000..d44909ca998a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "\\"
+ },
+ "name": "\\"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json
new file mode 100644
index 000000000000..38cc0c05b021
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "\\x"
+ },
+ "name": "\\x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/input.js
index a6e819ccd18b..ecb0a859c956 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/input.js
@@ -1 +1 @@
-\\u0000
+\u0000
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json
new file mode 100644
index 000000000000..380e6ec698ef
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "\u0000"
+ },
+ "name": "\u0000"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json
deleted file mode 100644
index 82bcfe621c49..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json
new file mode 100644
index 000000000000..d528d79e32d4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json
@@ -0,0 +1,102 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": ""
+ },
+ "name": ""
+ },
+ "right": {
+ "type": "ArrayExpression",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "elements": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json
deleted file mode 100644
index 82bcfe621c49..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid Unicode escape (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json
new file mode 100644
index 000000000000..91544094b698
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json
@@ -0,0 +1,102 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid Unicode escape (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": ""
+ },
+ "name": ""
+ },
+ "right": {
+ "type": "ArrayExpression",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "elements": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/input.js
index 2775e915bb92..1ef32f79a66e 100644
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/input.js
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/input.js
@@ -1 +1 @@
-"\\u
+"\u
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json
deleted file mode 100644
index f9d29c7f328c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'return' outside of function (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json
new file mode 100644
index 000000000000..e43da2374537
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: 'return' outside of function (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "argument": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json
deleted file mode 100644
index 701f9fe8f27a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json
new file mode 100644
index 000000000000..d3a105c584dd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json
deleted file mode 100644
index de66853a7a3d..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:0)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json
new file mode 100644
index 000000000000..c32c5b089115
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json
@@ -0,0 +1,54 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json
deleted file mode 100644
index c726e8fa98e4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json
new file mode 100644
index 000000000000..b83145faf5ab
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json
@@ -0,0 +1,106 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "SwitchStatement",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "discriminant": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "cases": [
+ {
+ "type": "SwitchCase",
+ "start": 13,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "consequent": [
+ {
+ "type": "ContinueStatement",
+ "start": 22,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "label": null
+ }
+ ],
+ "test": null
+ }
+ ]
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json
deleted file mode 100644
index 070e662e80d4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json
new file mode 100644
index 000000000000..a7c8d4f9a0ca
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "WhileStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 15,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json
deleted file mode 100644
index 2a2e15787aa7..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json
new file mode 100644
index 000000000000..2f1c8737b22e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "WhileStatement",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 15,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json
deleted file mode 100644
index 464af80a1561..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json
new file mode 100644
index 000000000000..7337acd3e8fd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json
@@ -0,0 +1,207 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 19,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 33,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 18
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json
deleted file mode 100644
index a056cb50e190..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json
new file mode 100644
index 000000000000..18bc9b977ca7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json
@@ -0,0 +1,207 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 19,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 18
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json
deleted file mode 100644
index 464af80a1561..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic break (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json
new file mode 100644
index 000000000000..59ae007d6fba
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json
@@ -0,0 +1,191 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic break (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 19,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "BreakStatement",
+ "start": 33,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 18
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json
deleted file mode 100644
index a056cb50e190..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unsyntactic continue (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json
new file mode 100644
index 000000000000..d26e37b08031
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json
@@ -0,0 +1,191 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "errors": [
+ "SyntaxError: Unsyntactic continue (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 18,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 19,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 31,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "body": [
+ {
+ "type": "ContinueStatement",
+ "start": 33,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "label": null
+ }
+ ],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 18
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json
deleted file mode 100644
index da7f2590db0b..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Label 'x' is already declared (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json
new file mode 100644
index 000000000000..3025d6bfbf72
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json
@@ -0,0 +1,199 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Label 'x' is already declared (1:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 3,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 18,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": {
+ "type": "WhileStatement",
+ "start": 21,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "test": {
+ "type": "BooleanLiteral",
+ "start": 28,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": true
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json
deleted file mode 100644
index 1517e1719333..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Deleting local variable in strict mode (1:29)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json
new file mode 100644
index 000000000000..f22f0efb0609
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "errors": [
+ "SyntaxError: Deleting local variable in strict mode (1:29)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 1,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "UnaryExpression",
+ "start": 29,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "operator": "delete",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json
deleted file mode 100644
index 31b4c6d2a040..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'with' in strict mode (1:29)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json
new file mode 100644
index 000000000000..1567b18881d6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json
@@ -0,0 +1,193 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "errors": [
+ "SyntaxError: 'with' in strict mode (1:29)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 1,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [
+ {
+ "type": "WithStatement",
+ "start": 29,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "body": {
+ "type": "EmptyStatement",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json
deleted file mode 100644
index dfbf1f6d0d1c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json
new file mode 100644
index 000000000000..7598b7431e9f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:36)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 32,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 36,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 43,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 43
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json
deleted file mode 100644
index b74dfcf59199..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json
new file mode 100644
index 000000000000..7101109189a2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:36)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 32,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 36,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 48,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json
deleted file mode 100644
index e95a2d7f7535..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:47)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json
new file mode 100644
index 000000000000..dd5fca85f2e5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:47)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 32,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 40,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 53,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json
deleted file mode 100644
index 14d96617b4b6..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:47)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json
new file mode 100644
index 000000000000..3b89f63424e2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:47)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 32,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 40,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 58,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 58
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json
deleted file mode 100644
index 6faa5d0476c3..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json
new file mode 100644
index 000000000000..2973f3517639
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 32,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 39,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json
deleted file mode 100644
index 2f502104f7d4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json
new file mode 100644
index 000000000000..e328a1e98ef9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 32,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 44,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 44
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json
deleted file mode 100644
index 0964911894d9..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:34)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json
new file mode 100644
index 000000000000..95091e65367d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:34)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "++",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json
deleted file mode 100644
index 0964911894d9..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:34)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json
new file mode 100644
index 000000000000..8473055a411c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:34)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "--",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json
deleted file mode 100644
index ba5ef9dd55cc..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:34)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json
new file mode 100644
index 000000000000..c9974932443e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:34)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "++",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json
deleted file mode 100644
index ba5ef9dd55cc..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:34)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json
new file mode 100644
index 000000000000..cf31420c53a0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:34)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "--",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json
deleted file mode 100644
index 6faa5d0476c3..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json
new file mode 100644
index 000000000000..59618c91e2ca
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "++",
+ "prefix": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json
deleted file mode 100644
index 6faa5d0476c3..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'eval' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json
new file mode 100644
index 000000000000..0b6b047c7b58
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'eval' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "operator": "--",
+ "prefix": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json
deleted file mode 100644
index 2f502104f7d4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json
new file mode 100644
index 000000000000..64f2c09fd91e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "++",
+ "prefix": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json
deleted file mode 100644
index 2f502104f7d4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Assigning to 'arguments' in strict mode (1:32)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json
new file mode 100644
index 000000000000..34c1b59c4e79
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json
@@ -0,0 +1,176 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "UpdateExpression",
+ "start": 32,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "--",
+ "prefix": false,
+ "argument": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json
deleted file mode 100644
index 439ffff53e89..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:41)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json
new file mode 100644
index 000000000000..35af060b7c6e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:41)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 32,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 48,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json
deleted file mode 100644
index ad15b27f9b9a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:41)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json
new file mode 100644
index 000000000000..7419ba446dc9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:41)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 32,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 53,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json
deleted file mode 100644
index 1eb91299eb1b..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json
new file mode 100644
index 000000000000..ede15490b692
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 17,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 17,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json
deleted file mode 100644
index c903c1205ce8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json
new file mode 100644
index 000000000000..aeccd1a07ed9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 22,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 22,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json
deleted file mode 100644
index 884ab94e3403..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:42)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json
new file mode 100644
index 000000000000..4e8af9c85d04
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json
@@ -0,0 +1,214 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:42)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 33,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 33,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 49
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json
deleted file mode 100644
index 58a98e4ca953..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:42)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json
new file mode 100644
index 000000000000..49a2e0086f28
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json
@@ -0,0 +1,214 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:42)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 60
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 33,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 33,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ "arguments": [],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json
deleted file mode 100644
index aa44c4aafa4d..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json
new file mode 100644
index 000000000000..6d1387258a3e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json
deleted file mode 100644
index 59ccf8eb8209..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json
new file mode 100644
index 000000000000..d3b5c3628386
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 23,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 23,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json
deleted file mode 100644
index e95a2d7f7535..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:47)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json
new file mode 100644
index 000000000000..d0eb8e29b2a1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json
@@ -0,0 +1,250 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:47)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 35,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "FunctionExpression",
+ "start": 38,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json
deleted file mode 100644
index e29c7aee6091..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'package' in strict mode (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json
new file mode 100644
index 000000000000..d6510094936e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'package' in strict mode (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "callee": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "package"
+ },
+ "name": "package"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 21,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 21,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json
deleted file mode 100644
index 43dc5662e1e5..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:48)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json
new file mode 100644
index 000000000000..98e096877880
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json
@@ -0,0 +1,292 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:48)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 35,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 38,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ }
+ },
+ {
+ "type": "ObjectMethod",
+ "start": 42,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 46,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 46
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "kind": "set",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 48,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json
deleted file mode 100644
index 439ffff53e89..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:41)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json
new file mode 100644
index 000000000000..f974d83f5a98
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json
@@ -0,0 +1,237 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:41)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 35,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "kind": "set",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 41,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 47,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json
deleted file mode 100644
index 8b18a4ec3e5a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:49)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json
new file mode 100644
index 000000000000..2993cf648835
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json
@@ -0,0 +1,268 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 64
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:49)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 64
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 64
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 64
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 62
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 33,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 60
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 35,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "FunctionExpression",
+ "start": 38,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ },
+ "identifierName": "s"
+ },
+ "name": "s"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 49,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 49
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 55,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 55
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 32
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 18,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 18,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json
deleted file mode 100644
index 794c4864d4e5..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json
new file mode 100644
index 000000000000..4534376b270a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 22,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 22,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json
deleted file mode 100644
index 212d35fcb5fe..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json
new file mode 100644
index 000000000000..cb41c2783446
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 27,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 27,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json
deleted file mode 100644
index 43dc5662e1e5..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:48)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json
new file mode 100644
index 000000000000..d8df2c1c2d07
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:48)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 58
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 33,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "inner"
+ },
+ "name": "inner"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 48,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 54,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 54
+ },
+ "end": {
+ "line": 1,
+ "column": 56
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json
deleted file mode 100644
index 8370ba5c765f..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:48)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json
new file mode 100644
index 000000000000..a2fc6cb4db0e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:48)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 63
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 33,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "inner"
+ },
+ "name": "inner"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 48,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 48
+ },
+ "end": {
+ "line": 1,
+ "column": 57
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 59,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 59
+ },
+ "end": {
+ "line": 1,
+ "column": 61
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json
deleted file mode 100644
index 61a5834b639e..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json
new file mode 100644
index 000000000000..48c8fda845ba
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": "\\1",
+ "extra": {
+ "raw": "\"\\1\"",
+ "rawValue": "\\1"
+ }
+ }
+ },
+ {
+ "type": "Directive",
+ "start": 6,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 6,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json
deleted file mode 100644
index ae2bfab55c68..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:35)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json
new file mode 100644
index 000000000000..1504ace4ac5d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:35)",
+ "SyntaxError: Octal literal in strict mode (1:35)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ },
+ {
+ "type": "Directive",
+ "start": 33,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 33,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "value": "\\1",
+ "extra": {
+ "raw": "\"\\1\"",
+ "rawValue": "\\1"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json
deleted file mode 100644
index 45ca229c1e8e..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json
new file mode 100644
index 000000000000..805c176e7856
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)",
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 33,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 33,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "021"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json
deleted file mode 100644
index 7e50b5f9165e..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:38)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json
new file mode 100644
index 000000000000..f73cb42cd9cf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json
@@ -0,0 +1,221 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:38)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 33,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 34,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 36,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "extra": {
+ "rawValue": "\u0001",
+ "raw": "\"\\1\""
+ },
+ "value": "\u0001"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 42,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 33
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json
deleted file mode 100644
index 8f6c8218f747..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Legacy octal literals are not allowed in strict mode (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json
new file mode 100644
index 000000000000..5eb3bcef0b18
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json
@@ -0,0 +1,221 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 33,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "expression": {
+ "type": "ObjectExpression",
+ "start": 34,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 36,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "NumericLiteral",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "021"
+ },
+ "value": 17
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 41,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 33
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "'use strict'",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json
deleted file mode 100644
index d094fe0284b1..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json
new file mode 100644
index 000000000000..374201e48c95
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:36)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 55
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "value": "octal directive\\1",
+ "extra": {
+ "raw": "\"octal directive\\1\"",
+ "rawValue": "octal directive\\1"
+ }
+ }
+ },
+ {
+ "type": "Directive",
+ "start": 40,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 40,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json
deleted file mode 100644
index d094fe0284b1..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json
new file mode 100644
index 000000000000..1c7a53167a1c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json
@@ -0,0 +1,197 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:36)",
+ "SyntaxError: Octal literal in strict mode (1:57)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "value": "octal directive\\1",
+ "extra": {
+ "raw": "\"octal directive\\1\"",
+ "rawValue": "octal directive\\1"
+ }
+ }
+ },
+ {
+ "type": "Directive",
+ "start": 40,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 60
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 40,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 59
+ }
+ },
+ "value": "octal directive\\2",
+ "extra": {
+ "raw": "\"octal directive\\2\"",
+ "rawValue": "octal directive\\2"
+ }
+ }
+ },
+ {
+ "type": "Directive",
+ "start": 61,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 61
+ },
+ "end": {
+ "line": 1,
+ "column": 74
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 61,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 61
+ },
+ "end": {
+ "line": 1,
+ "column": 73
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json
deleted file mode 100644
index 8389b2c726ca..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Octal literal in strict mode (1:69)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json
new file mode 100644
index 000000000000..e52fa38ccf73
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json
@@ -0,0 +1,215 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "errors": [
+ "SyntaxError: Octal literal in strict mode (1:69)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 76
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 33,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 74
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "inner"
+ },
+ "name": "inner"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 50,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 50
+ },
+ "end": {
+ "line": 1,
+ "column": 74
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 52,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 52
+ },
+ "end": {
+ "line": 1,
+ "column": 72
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 52,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 52
+ },
+ "end": {
+ "line": 1,
+ "column": 71
+ }
+ },
+ "value": "octal directive\\1",
+ "extra": {
+ "raw": "\"octal directive\\1\"",
+ "rawValue": "octal directive\\1"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json
deleted file mode 100644
index 0641de45e29a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'implements' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json
new file mode 100644
index 000000000000..2201ea3de8c6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'implements' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ },
+ "identifierName": "implements"
+ },
+ "name": "implements"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json
deleted file mode 100644
index 859238d0423f..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'interface' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json
new file mode 100644
index 000000000000..be76deabc7a1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'interface' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "interface"
+ },
+ "name": "interface"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json
deleted file mode 100644
index 344c7075f4bf..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'package' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json
new file mode 100644
index 000000000000..414e229fac38
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'package' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ },
+ "identifierName": "package"
+ },
+ "name": "package"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json
deleted file mode 100644
index 9fb9deaf9cba..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'private' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json
new file mode 100644
index 000000000000..32efcd46a632
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'private' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ },
+ "identifierName": "private"
+ },
+ "name": "private"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json
deleted file mode 100644
index 292fb56f1cf3..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'protected' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json
new file mode 100644
index 000000000000..e3d3f255c253
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'protected' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ },
+ "identifierName": "protected"
+ },
+ "name": "protected"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json
deleted file mode 100644
index d5f48446906a..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'public' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json
new file mode 100644
index 000000000000..2e801038c78d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'public' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "public"
+ },
+ "name": "public"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json
deleted file mode 100644
index 0f41ff2e6f24..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'static' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json
new file mode 100644
index 000000000000..4ed420518d6d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'static' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json
deleted file mode 100644
index 6ab197f35dc9..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'yield' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json
new file mode 100644
index 000000000000..55dc17f91beb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'yield' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ },
+ "identifierName": "yield"
+ },
+ "name": "yield"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json
deleted file mode 100644
index d2f3cbc2e116..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'let' (1:37)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json
new file mode 100644
index 000000000000..3b946aeb3223
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'let' (1:37)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 33,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "let"
+ },
+ "name": "let"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json
deleted file mode 100644
index 78c799ec6a49..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'static' in strict mode (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json
new file mode 100644
index 000000000000..ab669586dc27
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'static' in strict mode (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "hello"
+ },
+ "name": "hello"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 25,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 25,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json
deleted file mode 100644
index d4a2d92e5b45..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'static' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json
new file mode 100644
index 000000000000..be76a2099b54
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'static' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 20,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json
deleted file mode 100644
index 1eb91299eb1b..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json
new file mode 100644
index 000000000000..df217b6af2bc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json
deleted file mode 100644
index c903c1205ce8..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'arguments' in strict mode (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json
new file mode 100644
index 000000000000..0de7c6ba2ac0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'arguments' in strict mode (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 24,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 24,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json
deleted file mode 100644
index 91bc36d3f360..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'static' (1:23)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json
new file mode 100644
index 000000000000..c249f39209bf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'static' (1:23)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json
deleted file mode 100644
index 8b20b9a7df36..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json
new file mode 100644
index 000000000000..f945eeb57491
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json
deleted file mode 100644
index 85fd3822f433..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json
new file mode 100644
index 000000000000..f2ff5d38de33
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 19,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 19,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json
deleted file mode 100644
index 604b5896c2c5..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'package' in strict mode (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json
new file mode 100644
index 000000000000..2f734055a47a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'package' in strict mode (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "package"
+ },
+ "name": "package"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 22,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 22,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json
deleted file mode 100644
index 9d2a58081596..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:43)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json
new file mode 100644
index 000000000000..60ac3ce8c98c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json
@@ -0,0 +1,229 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:43)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 29,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 43,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 43
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 46,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 46
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 49,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 49
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json
deleted file mode 100644
index 61c3bbb5abe0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json
new file mode 100644
index 000000000000..766ec14c5a33
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json
@@ -0,0 +1,180 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 20,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json
deleted file mode 100644
index ae469fbd59da..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:44)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json
new file mode 100644
index 000000000000..0f2e3c5dce01
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json
@@ -0,0 +1,233 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:44)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 13,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 30,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ {
+ "type": "Identifier",
+ "start": 44,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 44
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 47,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [],
+ "directives": []
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 29
+ }
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 15,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json
deleted file mode 100644
index b60957f217a4..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'eval' in strict mode (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json
new file mode 100644
index 000000000000..7945e482ca86
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'eval' in strict mode (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "eval"
+ },
+ "name": "eval"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 20,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json
deleted file mode 100644
index 62075401e782..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Binding 'package' in strict mode (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json
new file mode 100644
index 000000000000..304b4237e9e7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding 'package' in strict mode (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 1,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 12,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "package"
+ },
+ "name": "package"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 23,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 23,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json
deleted file mode 100644
index cb5abd9f7401..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Label '__proto__' is already declared (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json
new file mode 100644
index 000000000000..2b1e638019cc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Label '__proto__' is already declared (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "LabeledStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": {
+ "type": "LabeledStatement",
+ "start": 11,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ }
+ },
+ "label": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json
deleted file mode 100644
index 505798d5a203..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Argument name clash (1:36)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json
new file mode 100644
index 000000000000..45d9e76d63b8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "errors": [
+ "SyntaxError: Argument name clash (1:36)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 14,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 25,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ {
+ "type": "Identifier",
+ "start": 36,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 47,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 50
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "use strict",
+ "extra": {
+ "raw": "\"use strict\"",
+ "rawValue": "use strict"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json
deleted file mode 100644
index 8e9b9f585996..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Redefinition of __proto__ property (1:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json
new file mode 100644
index 000000000000..6c9cf3db90bb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json
@@ -0,0 +1,213 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Redefinition of __proto__ property (1:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 4,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectProperty",
+ "start": 6,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "extra": {
+ "rawValue": 42,
+ "raw": "42"
+ },
+ "value": 42
+ }
+ },
+ {
+ "type": "ObjectProperty",
+ "start": 21,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "__proto__"
+ },
+ "name": "__proto__"
+ },
+ "computed": false,
+ "shorthand": false,
+ "value": {
+ "type": "NumericLiteral",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "extra": {
+ "rawValue": 43,
+ "raw": "43"
+ },
+ "value": 43
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json
deleted file mode 100644
index 8df109cb3c33..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Classes may not have static property named prototype (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json
new file mode 100644
index 000000000000..3c3b792e5b9b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have static property named prototype (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 9,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "static": true,
+ "key": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "prototype"
+ },
+ "name": "prototype"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json
deleted file mode 100644
index 8df109cb3c33..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Classes may not have static property named prototype (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json
new file mode 100644
index 000000000000..0c00e7e06841
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json
@@ -0,0 +1,147 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have static property named prototype (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 9,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "static": true,
+ "key": {
+ "type": "StringLiteral",
+ "start": 16,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "extra": {
+ "rawValue": "prototype",
+ "raw": "\"prototype\""
+ },
+ "value": "prototype"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json
deleted file mode 100644
index f4b1d256a4ab..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Constructor can't have get/set modifier (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json
new file mode 100644
index 000000000000..d583a2ec1119
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Constructor can't have get/set modifier (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 9,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "get",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json
deleted file mode 100644
index f4b1d256a4ab..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Constructor can't have get/set modifier (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json
new file mode 100644
index 000000000000..532d8ebe70a8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Constructor can't have get/set modifier (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 9,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "set",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ },
+ "identifierName": "m"
+ },
+ "name": "m"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json
deleted file mode 100644
index 4d892adceff9..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Duplicate constructor in the same class (1:25)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json
new file mode 100644
index 000000000000..4337adcf6eb6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json
@@ -0,0 +1,203 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "errors": [
+ "SyntaxError: Duplicate constructor in the same class (1:25)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 9,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "ClassMethod",
+ "start": 25,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "StringLiteral",
+ "start": 25,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "extra": {
+ "rawValue": "constructor",
+ "raw": "\"constructor\""
+ },
+ "value": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 40,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json
deleted file mode 100644
index aef7f56007e9..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'enum' (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json
new file mode 100644
index 000000000000..df10adea166e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'enum' (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 11,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "enum"
+ },
+ "name": "enum"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json
deleted file mode 100644
index 757b207f0ef2..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected reserved word 'static' (1:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json
new file mode 100644
index 000000000000..275b0d3ee35a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected reserved word 'static' (1:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 9,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "static": true,
+ "computed": true,
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "static"
+ },
+ "name": "static"
+ },
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json
deleted file mode 100644
index 0006fbf98e5c..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "setter function argument must not be a rest parameter (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json
new file mode 100644
index 000000000000..30ec6b3832e2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json
@@ -0,0 +1,192 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: setter function argument must not be a rest parameter (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 4,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 6,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "method": false,
+ "key": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "computed": false,
+ "kind": "set",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "RestElement",
+ "start": 12,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/options.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json
new file mode 100644
index 000000000000..e418d699ca2c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "\\a"
+ },
+ "name": "\\a"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/options.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/options.json
deleted file mode 100644
index 18c53b997b56..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json
new file mode 100644
index 000000000000..6f022e5637c6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "aa\\a"
+ },
+ "name": "aa\\a"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/options.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json
new file mode 100644
index 000000000000..c0f511826127
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "\\aa"
+ },
+ "name": "\\aa"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/options.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/options.json
deleted file mode 100644
index 381fd12ce2d0..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json
new file mode 100644
index 000000000000..c0f511826127
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json
@@ -0,0 +1,70 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "\\aa"
+ },
+ "name": "\\aa"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json
deleted file mode 100644
index 57893e4eee56..000000000000
--- a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Complex binding patterns require an initialization value (1:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json
new file mode 100644
index 000000000000..8c9fa87e494e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json
@@ -0,0 +1,88 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Complex binding patterns require an initialization value (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "id": {
+ "type": "ArrayPattern",
+ "start": 4,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "elements": []
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/options.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/options.json
deleted file mode 100644
index a1fd77a3341e..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid BigIntLiteral (1:0)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/output.json
new file mode 100644
index 000000000000..26cbd0245288
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid BigIntLiteral (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "BigIntLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": "1.0",
+ "raw": "1.0n"
+ },
+ "value": "1.0"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/options.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/options.json
deleted file mode 100644
index a1fd77a3341e..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid BigIntLiteral (1:0)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/output.json
new file mode 100644
index 000000000000..527c53215960
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid BigIntLiteral (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "BigIntLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": "2e9",
+ "raw": "2e9n"
+ },
+ "value": "2e9"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json
index a1fd77a3341e..8078d8f00dad 100644
--- a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json
@@ -1 +1,5 @@
-{ "throws": "Invalid BigIntLiteral (1:0)" }
+{
+ "plugins": [
+ "bigInt"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/output.json
new file mode 100644
index 000000000000..86220085cd71
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid BigIntLiteral (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "BigIntLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": "089",
+ "raw": "089n"
+ },
+ "value": "089"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/options.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/options.json
deleted file mode 100644
index a1fd77a3341e..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid BigIntLiteral (1:0)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/output.json
new file mode 100644
index 000000000000..baa4133652f9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid BigIntLiteral (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "BigIntLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": "016432",
+ "raw": "016432n"
+ },
+ "value": "016432"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/options.json
index d702f4db972b..a6ccef275874 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/options.json
@@ -1,4 +1,5 @@
{
- "throws": "Classes may not have a private field named '#constructor' (2:2)",
- "plugins": ["classPrivateMethods"]
-}
+ "plugins": [
+ "classPrivateMethods"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json
new file mode 100644
index 000000000000..342fc174b592
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json
@@ -0,0 +1,158 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have a private field named '#constructor' (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateMethod",
+ "start": 14,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ }
+ },
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/options.json
index 9914950b66fe..8d265ec66c23 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/options.json
@@ -1,4 +1,3 @@
{
- "throws": "Unexpected space between # and identifier (2:3)",
"plugins": ["classPrivateMethods"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json
new file mode 100644
index 000000000000..e126bf7fb5fb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json
@@ -0,0 +1,207 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected space between # and identifier (2:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "Spaces"
+ },
+ "name": "Spaces"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 13,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateMethod",
+ "start": 17,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 17,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "wrongSpaces"
+ },
+ "name": "wrongSpaces"
+ }
+ },
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 40,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "argument": {
+ "type": "CallExpression",
+ "start": 47,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "identifierName": "fail"
+ },
+ "name": "fail"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/options.json
index e9f18e93d1d5..1ca5069a3a2f 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/options.json
@@ -1,4 +1,5 @@
{
- "throws": "Deleting a private field is not allowed (4:4)",
- "plugins": ["classPrivateProperties"]
-}
+ "plugins": [
+ "classPrivateProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json
new file mode 100644
index 000000000000..1f5d18e55096
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json
@@ -0,0 +1,289 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Deleting a private field is not allowed (4:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ },
+ "value": null
+ },
+ {
+ "type": "ClassMethod",
+ "start": 20,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 40,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "UnaryExpression",
+ "start": 40,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "operator": "delete",
+ "prefix": true,
+ "argument": {
+ "type": "MemberExpression",
+ "start": 47,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "object": {
+ "type": "ThisExpression",
+ "start": 47,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ }
+ },
+ "property": {
+ "type": "PrivateName",
+ "start": 52,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 53,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ },
+ "computed": false
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/options.json
index 51343aac3b23..1ca5069a3a2f 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/options.json
@@ -1,4 +1,5 @@
{
- "throws": "Classes may not have a private field named '#constructor' (2:2)",
- "plugins": ["classPrivateProperties"]
-}
+ "plugins": [
+ "classPrivateProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json
new file mode 100644
index 000000000000..1f4da38f9f9f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have a private field named '#constructor' (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 14,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/options.json
index 9914950b66fe..f26e916957c8 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/options.json
@@ -1,4 +1,3 @@
{
- "throws": "Unexpected space between # and identifier (2:3)",
- "plugins": ["classPrivateMethods"]
+ "plugins": ["classPrivateProperties"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json
new file mode 100644
index 000000000000..34003e4e9209
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected space between # and identifier (2:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "Spaces"
+ },
+ "name": "Spaces"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 13,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 17,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 17,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "wrongSpaces"
+ },
+ "name": "wrongSpaces"
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/options.json
index 2154c844bfd7..1ca5069a3a2f 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["classPrivateProperties"],
- "throws": "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:13)"
-}
+ "plugins": [
+ "classPrivateProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json
new file mode 100644
index 000000000000..26e00894a7a7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json
@@ -0,0 +1,306 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "body": {
+ "type": "ClassBody",
+ "start": 18,
+ "end": 95,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 22,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 42,
+ "end": 89,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "superClass": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ },
+ "identifierName": "D"
+ },
+ "name": "D"
+ },
+ "body": {
+ "type": "ClassBody",
+ "start": 60,
+ "end": 89,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 68,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 68,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 69,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ },
+ "value": {
+ "type": "CallExpression",
+ "start": 75,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 20
+ }
+ },
+ "callee": {
+ "type": "Super",
+ "start": 75,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ }
+ },
+ "arguments": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json
index 162c282e64a2..1ca5069a3a2f 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json
@@ -1,6 +1,5 @@
{
"plugins": [
"classPrivateProperties"
- ],
- "throws": "Private fields can't be accessed on super (5:4)"
-}
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json
new file mode 100644
index 000000000000..bf5051685be7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json
@@ -0,0 +1,288 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Private fields can't be accessed on super (5:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "body": {
+ "type": "ClassBody",
+ "start": 18,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ },
+ "value": null
+ },
+ {
+ "type": "ClassMethod",
+ "start": 29,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ },
+ "identifierName": "method"
+ },
+ "name": "method"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 38,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 44,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 44,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "object": {
+ "type": "Super",
+ "start": 44,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ }
+ },
+ "property": {
+ "type": "PrivateName",
+ "start": 50,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 51,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ },
+ "computed": false
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/options.json
index a567b19a72cb..7f9944b56296 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["classProperties"],
- "throws": "'arguments' is not allowed in class field initializer (3:16)"
-}
+ "plugins": [
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json
new file mode 100644
index 000000000000..7cd90e6e9021
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json
@@ -0,0 +1,211 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: 'arguments' is not allowed in class field initializer (3:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 18,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 26,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 32,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "value": {
+ "type": "ArrowFunctionExpression",
+ "start": 38,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json
index e79a44db0bef..7f9944b56296 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["classProperties"],
- "throws": "'arguments' is not allowed in class field initializer (3:10)"
-}
+ "plugins": [
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json
new file mode 100644
index 000000000000..f2522558f086
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json
@@ -0,0 +1,192 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: 'arguments' is not allowed in class field initializer (3:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 14,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 18,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 26,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 32,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "value": {
+ "type": "Identifier",
+ "start": 38,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ },
+ "identifierName": "arguments"
+ },
+ "name": "arguments"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/options.json
index 8d36a47b9f64..7f9944b56296 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["classProperties"],
- "throws": "new.target can only be used in functions or class properties (1:8)"
-}
+ "plugins": [
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json
new file mode 100644
index 000000000000..a44ee2efc222
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: new.target can only be used in functions or class properties (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "MetaProperty",
+ "start": 8,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "new"
+ },
+ "name": "new"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "target"
+ },
+ "name": "target"
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/options.json
index 5560d1052435..7c697d760098 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/options.json
@@ -1,4 +1,5 @@
{
- "throws": "Classes may not have a field named 'constructor' (2:2)",
- "plugins": ["classProperties"]
+ "plugins": [
+ "classProperties"
+ ]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json
new file mode 100644
index 000000000000..0678d1917926
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have a field named 'constructor' (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "value": null
+ },
+ {
+ "type": "ClassMethod",
+ "start": 28,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "static": false,
+ "kind": "method",
+ "key": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 3
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/options.json
index 5560d1052435..7c697d760098 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/options.json
@@ -1,4 +1,5 @@
{
- "throws": "Classes may not have a field named 'constructor' (2:2)",
- "plugins": ["classProperties"]
+ "plugins": [
+ "classProperties"
+ ]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json
new file mode 100644
index 000000000000..2a969d61e76e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json
@@ -0,0 +1,123 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have a field named 'constructor' (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json
index 5bde2716ebdd..7f9944b56296 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json
@@ -1,4 +1,5 @@
{
- "throws": "Classes may not have static property named prototype (2:9)",
- "plugins": ["classProperties"]
-}
+ "plugins": [
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json
new file mode 100644
index 000000000000..975df8dd8199
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json
@@ -0,0 +1,179 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have static property named prototype (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 14,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "static": true,
+ "key": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "prototype"
+ },
+ "name": "prototype"
+ },
+ "computed": false,
+ "value": null
+ },
+ {
+ "type": "ClassMethod",
+ "start": 33,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "static": false,
+ "kind": "method",
+ "key": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 3
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false,
+ "id": null,
+ "generator": true,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 37,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/options.json
index 5bde2716ebdd..7f9944b56296 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/options.json
@@ -1,4 +1,5 @@
{
- "throws": "Classes may not have static property named prototype (2:9)",
- "plugins": ["classProperties"]
-}
+ "plugins": [
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json
new file mode 100644
index 000000000000..fb3005664209
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json
@@ -0,0 +1,123 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have static property named prototype (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 14,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "static": true,
+ "key": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "prototype"
+ },
+ "name": "prototype"
+ },
+ "computed": false,
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json
index 36858dc626ae..7f9944b56296 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json
@@ -1,4 +1,5 @@
{
- "throws": "Classes may not have a field named 'constructor' (2:11)",
- "plugins": ["classProperties"]
-}
+ "plugins": [
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json
new file mode 100644
index 000000000000..74fd91c747c5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json
@@ -0,0 +1,123 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have a field named 'constructor' (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 16,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "static": true,
+ "key": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/options.json
index e8d509e27740..7f9944b56296 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["classProperties"],
- "throws": "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:12)"
-}
+ "plugins": [
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json
new file mode 100644
index 000000000000..987d1eef5055
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json
@@ -0,0 +1,292 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "body": {
+ "type": "ClassBody",
+ "start": 18,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 22,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 42,
+ "end": 88,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "superClass": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ },
+ "identifierName": "D"
+ },
+ "name": "D"
+ },
+ "body": {
+ "type": "ClassBody",
+ "start": 60,
+ "end": 88,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 68,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 20
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 68,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "value": {
+ "type": "CallExpression",
+ "start": 74,
+ "end": 81,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "callee": {
+ "type": "Super",
+ "start": 74,
+ "end": 79,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ }
+ },
+ "arguments": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/options.json
index 386c2968e7b0..7f9944b56296 100644
--- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["classProperties"],
- "throws": "super is only allowed in object methods and classes (3:4)"
-}
+ "plugins": [
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json
new file mode 100644
index 000000000000..b129c88406f6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json
@@ -0,0 +1,254 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: super is only allowed in object methods and classes (3:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 12,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "value": {
+ "type": "FunctionExpression",
+ "start": 18,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "fn"
+ },
+ "name": "fn"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 32,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 38,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 38,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "callee": {
+ "type": "MemberExpression",
+ "start": 38,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "object": {
+ "type": "Super",
+ "start": 38,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/options.json
index 39592e4eb294..70c2c7a17676 100644
--- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/options.json
@@ -1,5 +1,11 @@
{
- "sourceType": "module",
- "plugins": [["decorators", { "decoratorsBeforeExport": true }]],
- "throws": "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax (1:15)"
-}
+ "plugins": [
+ [
+ "decorators",
+ {
+ "decoratorsBeforeExport": true
+ }
+ ]
+ ],
+ "sourceType": "module"
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json
new file mode 100644
index 000000000000..2ac3ce6a5954
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json
@@ -0,0 +1,136 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "errors": [
+ "SyntaxError: Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "declaration": {
+ "type": "ClassDeclaration",
+ "start": 15,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "decorators": [
+ {
+ "type": "Decorator",
+ "start": 15,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "decorator"
+ },
+ "name": "decorator"
+ }
+ }
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 36,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/options.json
deleted file mode 100644
index 7b4e6dc626ae..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Stage 2 decorators cannot be used to decorate parameters (2:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json
new file mode 100644
index 000000000000..9f8814a38f61
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json
@@ -0,0 +1,196 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (2:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ },
+ "identifierName": "x"
+ },
+ "name": "x",
+ "decorators": [
+ {
+ "type": "Decorator",
+ "start": 26,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/options.json
deleted file mode 100644
index a26ed7cacb84..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "You can't attach decorators to a class constructor (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json
new file mode 100644
index 000000000000..084e74570676
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "decorators": [
+ {
+ "type": "Decorator",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "abc"
+ },
+ "name": "abc"
+ }
+ }
+ ],
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/options.json
index cb54fc794402..2104ca43283f 100644
--- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/options.json
@@ -1,4 +1,3 @@
{
- "sourceType": "module",
- "throws": "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (2:0)"
+ "sourceType": "module"
}
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json
new file mode 100644
index 000000000000..733e482e120a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json
@@ -0,0 +1,120 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (2:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 5,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "declaration": {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "decorators": [
+ {
+ "type": "Decorator",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ],
+ "id": null,
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "body": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/options.json
deleted file mode 100644
index 6637fc7f8345..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Stage 2 decorators cannot be used to decorate parameters (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json
new file mode 100644
index 000000000000..ec6b85a88a6b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json
@@ -0,0 +1,142 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "func"
+ },
+ "name": "func"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "x"
+ },
+ "name": "x",
+ "decorators": [
+ {
+ "type": "Decorator",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/options.json
deleted file mode 100644
index b1730696933e..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Stage 2 decorators cannot be used to decorate parameters (2:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json
new file mode 100644
index 000000000000..2819428d5aef
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json
@@ -0,0 +1,213 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "obj"
+ },
+ "name": "obj"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 10,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 14,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "identifierName": "method"
+ },
+ "name": "method"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "x"
+ },
+ "name": "x",
+ "decorators": [
+ {
+ "type": "Decorator",
+ "start": 21,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ ]
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json
index 7dd4ed9e2837..69639859c25e 100644
--- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json
@@ -1,3 +1,10 @@
{
- "throws": "Stage 2 decorators disallow object literal property decorators (2:2)"
-}
+ "plugins": [
+ [
+ "decorators",
+ {
+ "decoratorsBeforeExport": false
+ }
+ ]
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json
new file mode 100644
index 000000000000..e50713954be0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Stage 2 decorators disallow object literal property decorators (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "o"
+ },
+ "name": "o"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 8,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 19,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "decorators": [
+ {
+ "type": "Decorator",
+ "start": 12,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "baz"
+ },
+ "name": "baz"
+ }
+ }
+ ],
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/options.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/options.json
deleted file mode 100644
index a26ed7cacb84..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "You can't attach decorators to a class constructor (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json
new file mode 100644
index 000000000000..084e74570676
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json
@@ -0,0 +1,178 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "decorators": [
+ {
+ "type": "Decorator",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "abc"
+ },
+ "name": "abc"
+ }
+ }
+ ],
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json
index 599298db4614..fae0a8fe39ac 100644
--- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json
@@ -1,3 +1,5 @@
{
- "throws": "Dynamic imports require a parameter: import('a.js') (2:9)"
-}
+ "plugins": [
+ "dynamicImport"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json
new file mode 100644
index 000000000000..07f26c50d81d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Dynamic imports require a parameter: import('a.js') (2:9)",
+ "SyntaxError: The only valid meta property for import is import.meta (2:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "failsParse"
+ },
+ "name": "failsParse"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 26,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "argument": {
+ "type": "CallExpression",
+ "start": 33,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "callee": {
+ "type": "MetaProperty",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "import"
+ },
+ "name": "import"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 40,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ },
+ "identifierName": "then"
+ },
+ "name": "then"
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json
index c4e1e2ffeb50..fae0a8fe39ac 100644
--- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json
@@ -1,3 +1,5 @@
{
- "throws": "... is not allowed in import() (1:7)"
-}
+ "plugins": [
+ "dynamicImport"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json
new file mode 100644
index 000000000000..d6eaecc7e5c0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: ... is not allowed in import() (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "callee": {
+ "type": "Import",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "SpreadElement",
+ "start": 7,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "argument": {
+ "type": "ArrayExpression",
+ "start": 10,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json
index 26e64ffc5d96..fae0a8fe39ac 100644
--- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json
@@ -1,3 +1,5 @@
{
- "throws": "Cannot use new with import(...) (1:4)"
-}
+ "plugins": [
+ "dynamicImport"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json
new file mode 100644
index 000000000000..a0b8467953bc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json
@@ -0,0 +1,105 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot use new with import(...) (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "NewExpression",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "callee": {
+ "type": "Import",
+ "start": 4,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "StringLiteral",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json
index ae6f5f18ff31..329bfdd92330 100644
--- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json
@@ -1,3 +1,5 @@
{
- "throws": "Trailing comma is disallowed inside import(...) arguments (1:12)"
+ "plugins": [
+ "dynamicImport"
+ ]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json
new file mode 100644
index 000000000000..fde34fb849ab
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Trailing comma is disallowed inside import(...) arguments (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "callee": {
+ "type": "Import",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ }
+ },
+ "extra": {
+ "trailingComma": 12
+ },
+ "arguments": [
+ {
+ "type": "StringLiteral",
+ "start": 7,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json
index 95a99c52ae49..fae0a8fe39ac 100644
--- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json
@@ -1,3 +1,5 @@
{
- "throws": "import() requires exactly one argument (1:0)"
-}
+ "plugins": [
+ "dynamicImport"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json
new file mode 100644
index 000000000000..f66dbbf22885
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json
@@ -0,0 +1,125 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: import() requires exactly one argument (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "callee": {
+ "type": "Import",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "StringLiteral",
+ "start": 7,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": "hello",
+ "raw": "'hello'"
+ },
+ "value": "hello"
+ },
+ {
+ "type": "StringLiteral",
+ "start": 16,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "extra": {
+ "rawValue": "world",
+ "raw": "'world'"
+ },
+ "value": "world"
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json
index 95a99c52ae49..fae0a8fe39ac 100644
--- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json
@@ -1,3 +1,5 @@
{
- "throws": "import() requires exactly one argument (1:0)"
-}
+ "plugins": [
+ "dynamicImport"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json
new file mode 100644
index 000000000000..9f50d0da240c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json
@@ -0,0 +1,84 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: import() requires exactly one argument (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "callee": {
+ "type": "Import",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ }
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/options.json b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/options.json
index eb1e545759e8..cdbf46968b69 100644
--- a/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/options.json
@@ -1,5 +1,7 @@
{
- "throws": "import.meta may appear only with 'sourceType: \"module\"' (1:10)",
- "plugins": ["dynamicImport", "importMeta"],
+ "plugins": [
+ "dynamicImport",
+ "importMeta"
+ ],
"sourceType": "script"
-}
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json
new file mode 100644
index 000000000000..12e01e17c23c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: import.meta may appear only with 'sourceType: \"module\"' (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "MetaProperty",
+ "start": 10,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "import"
+ },
+ "name": "import"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "meta"
+ },
+ "name": "meta"
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json
index 97ba83ec465d..e05ac2744632 100644
--- a/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json
@@ -1,5 +1,7 @@
{
- "throws": "The only valid meta property for import is import.meta (1:7)",
"sourceType": "module",
- "plugins": ["dynamicImport", "importMeta"]
-}
+ "plugins": [
+ "dynamicImport",
+ "importMeta"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json
new file mode 100644
index 000000000000..9b2370d8c3ec
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json
@@ -0,0 +1,102 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: The only valid meta property for import is import.meta (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "MetaProperty",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "import"
+ },
+ "name": "import"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "notMeta"
+ },
+ "name": "notMeta"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/options.json b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/options.json
index 647ad9f65dee..e05ac2744632 100644
--- a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/options.json
@@ -1,5 +1,7 @@
{
- "throws": "Invalid left-hand side in assignment expression (1:0)",
"sourceType": "module",
- "plugins": ["dynamicImport", "importMeta"]
-}
+ "plugins": [
+ "dynamicImport",
+ "importMeta"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json
new file mode 100644
index 000000000000..7610536beafc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid left-hand side in assignment expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "MetaProperty",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "meta": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "import"
+ },
+ "name": "import"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "meta"
+ },
+ "name": "meta"
+ }
+ },
+ "right": {
+ "type": "BooleanLiteral",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": true
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/options.json
deleted file mode 100644
index 27e4acfa8f65..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:1)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json
new file mode 100644
index 000000000000..bed1899ddc7e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1_"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json
new file mode 100644
index 000000000000..c1dac7764035
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1_"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json
new file mode 100644
index 000000000000..6839504edf6c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json
new file mode 100644
index 000000000000..c7f4877e2059
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 1
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json
new file mode 100644
index 000000000000..1b343c302559
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json
new file mode 100644
index 000000000000..2ab61fd7bb04
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json
@@ -0,0 +1,76 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1__",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json
new file mode 100644
index 000000000000..e799ede442c5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json
@@ -0,0 +1,76 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1__1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json
new file mode 100644
index 000000000000..7eef10ad862b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1_.1_1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 11.11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json
new file mode 100644
index 000000000000..5a3cc58cada8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1._1_1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 11.11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json
new file mode 100644
index 000000000000..45e0aecd2129
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_e1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json
new file mode 100644
index 000000000000..73400bf8fd10
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_E1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json
new file mode 100644
index 000000000000..6c6aa937ac70
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1e_1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json
new file mode 100644
index 000000000000..a646828811ea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1E_1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json
new file mode 100644
index 000000000000..0a1b0a11038e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0xa_1_"
+ },
+ "value": 161
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json
new file mode 100644
index 000000000000..34647c6e63c9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x1_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json
new file mode 100644
index 000000000000..e33208bf5970
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0xa_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 161
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json
new file mode 100644
index 000000000000..48e2d915883b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0x_a_1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 161
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json
new file mode 100644
index 000000000000..af714540b44f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json
@@ -0,0 +1,77 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x__1_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json
new file mode 100644
index 000000000000..151f29fb87dc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json
@@ -0,0 +1,77 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1__1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json
new file mode 100644
index 000000000000..3ec08e9eab54
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json
@@ -0,0 +1,76 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json
new file mode 100644
index 000000000000..b79700fd396f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json
new file mode 100644
index 000000000000..c0bcbc71a47a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_11",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json
new file mode 100644
index 000000000000..00976d92c50f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json
@@ -0,0 +1,76 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_01_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json
new file mode 100644
index 000000000000..1858a06292b1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_0_1_1",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json
new file mode 100644
index 000000000000..a3ac3d5828d0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0x_a_1"
+ },
+ "value": 161
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json
new file mode 100644
index 000000000000..0b18241bc1c5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json
@@ -0,0 +1,76 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_01_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json
new file mode 100644
index 000000000000..c478966220d4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b01_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json
new file mode 100644
index 000000000000..3c73b3979a52
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o1_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json
new file mode 100644
index 000000000000..7b4538c88e9c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json
@@ -0,0 +1,76 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1_",
+ "parenthesized": true,
+ "parenStart": 0
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json
new file mode 100644
index 000000000000..55f03701d9db
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1_"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json
new file mode 100644
index 000000000000..4c87cc2b22a7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1_"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json
new file mode 100644
index 000000000000..65bec6bcbd60
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json
@@ -0,0 +1,92 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1__"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json
new file mode 100644
index 000000000000..740a870e3ad3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json
@@ -0,0 +1,92 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1__1"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json
new file mode 100644
index 000000000000..8b3ea170250c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1_.1_1"
+ },
+ "value": 11.11
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json
new file mode 100644
index 000000000000..a30df38017e0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1._1_1"
+ },
+ "value": 11.11
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json
new file mode 100644
index 000000000000..78257d308a98
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x__1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json
new file mode 100644
index 000000000000..a3ea6fad2e5a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_e1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json
new file mode 100644
index 000000000000..6461d8dba2bd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_E1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json
new file mode 100644
index 000000000000..d27ae3b4fadf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1e_1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json
new file mode 100644
index 000000000000..ee4395d21f55
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1E_1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json
new file mode 100644
index 000000000000..29dc70b2487f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json
new file mode 100644
index 000000000000..f08afb905eac
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0xa_1_"
+ },
+ "value": 161
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json
new file mode 100644
index 000000000000..2507a579d6de
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0x_a_1"
+ },
+ "value": 161
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json
new file mode 100644
index 000000000000..89afd3efde35
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json
@@ -0,0 +1,93 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x__1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json
new file mode 100644
index 000000000000..8cad1428818e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json
@@ -0,0 +1,93 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1__1"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json
new file mode 100644
index 000000000000..9d86aac2191a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json
@@ -0,0 +1,92 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json
new file mode 100644
index 000000000000..477b3c1f3cf4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1__1"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json
new file mode 100644
index 000000000000..73b694a6656c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json
new file mode 100644
index 000000000000..3e602cf8e35b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_11"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json
new file mode 100644
index 000000000000..7b96b478be97
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json
@@ -0,0 +1,92 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_01_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json
new file mode 100644
index 000000000000..bd3c89e95560
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_0_1_1"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json
new file mode 100644
index 000000000000..df4e4858faae
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json
@@ -0,0 +1,92 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_01_1_"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json
new file mode 100644
index 000000000000..f9203546d16c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b01_1_"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json
new file mode 100644
index 000000000000..3138ed92346a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o1_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json
new file mode 100644
index 000000000000..5cd647c2bf7d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json
@@ -0,0 +1,92 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "BlockStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json
new file mode 100644
index 000000000000..a43596db0e4e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json
new file mode 100644
index 000000000000..c6b51546660e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json
new file mode 100644
index 000000000000..4788bc887407
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_11"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json
new file mode 100644
index 000000000000..e797620a329e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_01_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json
new file mode 100644
index 000000000000..509fa7be5376
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_0_1_1"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json
new file mode 100644
index 000000000000..71b523cdc3f5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1__"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json
new file mode 100644
index 000000000000..386c54cac8e1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_01_1_"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json
new file mode 100644
index 000000000000..99329263441c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b01_1_"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json
new file mode 100644
index 000000000000..031ce3f9fcf2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o1_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json
new file mode 100644
index 000000000000..cf60b4557bd1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json
new file mode 100644
index 000000000000..0de8505e1170
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: Expected number in radix 8 (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 8,
+ "raw": "0o01_8"
+ },
+ "value": 8
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/options.json
deleted file mode 100644
index 7f37dbb4686b..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Expected number in radix 2 (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json
new file mode 100644
index 000000000000..ab45a08cb897
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected number in radix 2 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "0b2_1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-27/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-27/options.json
index fab06a453d2f..ee18527964e7 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-27/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-27/options.json
@@ -1 +1,3 @@
-{ "throws": "Expected number in radix 16 (1:2)" }
+{
+ "throws": "Identifier directly after number (1:2)"
+}
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/options.json
deleted file mode 100644
index 27e4acfa8f65..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:1)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json
new file mode 100644
index 000000000000..22352b5f300f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1_"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json
new file mode 100644
index 000000000000..109e14677751
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1_"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/options.json
deleted file mode 100644
index 27e4acfa8f65..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:1)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json
new file mode 100644
index 000000000000..39f6afe910ec
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:1)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1__1"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json
new file mode 100644
index 000000000000..422bdd6c6384
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1__"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/options.json
deleted file mode 100644
index 27e4acfa8f65..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:1)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json
new file mode 100644
index 000000000000..4cf178b2082e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:1)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1__1"
+ },
+ "value": 11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json
new file mode 100644
index 000000000000..3ac121a5eece
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1_.1_1"
+ },
+ "value": 11.11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json
new file mode 100644
index 000000000000..4e344f6fd3bf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1._1_1"
+ },
+ "value": 11.11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json
new file mode 100644
index 000000000000..d8a2a2deda67
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_e1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json
new file mode 100644
index 000000000000..0b63b9681805
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_E1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json
new file mode 100644
index 000000000000..6a9efc69296c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1e_1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json
new file mode 100644
index 000000000000..f68c59283508
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1E_1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json
new file mode 100644
index 000000000000..0c35b0296649
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json
new file mode 100644
index 000000000000..8076713df223
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0xa_1_"
+ },
+ "value": 161
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json
new file mode 100644
index 000000000000..ad70ca6fc270
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1_.1_1"
+ },
+ "value": 11.11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json
new file mode 100644
index 000000000000..31bfeccc15a7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0x_a_1"
+ },
+ "value": 161
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json
new file mode 100644
index 000000000000..ca8eaf7c7c31
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x__1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json
new file mode 100644
index 000000000000..689560a3bb3c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json
@@ -0,0 +1,75 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1__1"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json
new file mode 100644
index 000000000000..b92b88fa4a19
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1_1_"
+ },
+ "value": 17
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json
new file mode 100644
index 000000000000..9487edc545b8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json
new file mode 100644
index 000000000000..1c39ba7a1d72
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_11"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json
new file mode 100644
index 000000000000..2890e46ca71d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_01_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json
new file mode 100644
index 000000000000..6de8c77bf903
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_0_1_1"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json
new file mode 100644
index 000000000000..ae93a109760c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_01_1_"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json
new file mode 100644
index 000000000000..fdede7a21ac0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b01_1_"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json
new file mode 100644
index 000000000000..ae808dbc99cf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1._1_1"
+ },
+ "value": 11.11
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json
new file mode 100644
index 000000000000..784d1a34983e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o1_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json
new file mode 100644
index 000000000000..678bccf4fa1e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1_"
+ },
+ "value": 9
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/input.js
index b6b4f448099d..475f52e0eb50 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/input.js
@@ -1 +1 @@
-1_,
+1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/options.json
deleted file mode 100644
index 27e4acfa8f65..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:1)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json
new file mode 100644
index 000000000000..2c53bf532cbd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1_"
+ },
+ "value": 1
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/input.js
index 4b8047ea34a5..ce3480ab5810 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/input.js
@@ -1 +1 @@
-1_1_,
+1_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json
new file mode 100644
index 000000000000..f3956eac0884
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1_"
+ },
+ "value": 11
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/input.js
index cac8642d14e7..be4906c68d09 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/input.js
@@ -1 +1 @@
-1_1__,
+1_1__, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json
new file mode 100644
index 000000000000..fa8e18cac1a1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json
@@ -0,0 +1,111 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1__"
+ },
+ "value": 11
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/input.js
index a9051bb2db71..10191f1bd355 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/input.js
@@ -1 +1 @@
-1__1,
+1__1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/options.json
deleted file mode 100644
index 27e4acfa8f65..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:1)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json
new file mode 100644
index 000000000000..d2ac83f6572e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json
@@ -0,0 +1,111 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:1)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1__1"
+ },
+ "value": 11
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/input.js
index 7213755d0f38..be9c6e14d226 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/input.js
@@ -1 +1 @@
-1_1_.1_1,
+1_1_.1_1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json
new file mode 100644
index 000000000000..154d9a6f4641
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1_.1_1"
+ },
+ "value": 11.11
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/input.js
index db8717756d2a..e2a13541725e 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/input.js
@@ -1 +1 @@
-1_1._1_1,
+1_1._1_1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json
new file mode 100644
index 000000000000..6e462c0e07d4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1._1_1"
+ },
+ "value": 11.11
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/input.js
index 5e5e356da976..49539d8e1686 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/input.js
@@ -1 +1 @@
-1_1.1_e1,
+1_1.1_e1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json
new file mode 100644
index 000000000000..95a795d633b6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_e1"
+ },
+ "value": 111
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/input.js
index b07556e6d95e..b06fd2edbbc4 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/input.js
@@ -1 +1 @@
-1_1.1_E1,
+1_1.1_E1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json
new file mode 100644
index 000000000000..51953305e0c8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_E1"
+ },
+ "value": 111
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json
new file mode 100644
index 000000000000..d0b1538b39dc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_e1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/input.js
index 0186dfaccb82..61f6290af574 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/input.js
@@ -1 +1 @@
-1_1.1e_1,
+1_1.1e_1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json
new file mode 100644
index 000000000000..a394466973f3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1e_1"
+ },
+ "value": 111
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/input.js
index 85594dea3099..026cf8e40d3a 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/input.js
@@ -1 +1 @@
-1_1.1E_1,
+1_1.1E_1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json
new file mode 100644
index 000000000000..36605277710f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1E_1"
+ },
+ "value": 111
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/input.js
index e0ed0c98f626..b34d9ea95a4d 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/input.js
@@ -1 +1 @@
-0x1_1_,
+0x1_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json
new file mode 100644
index 000000000000..347125ca2b1d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x1_1_"
+ },
+ "value": 17
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/input.js
index d1b793f8dfed..28a917a7aca3 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/input.js
@@ -1 +1 @@
-0xa_1_,
+0xa_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json
new file mode 100644
index 000000000000..ac06aae7f847
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0xa_1_"
+ },
+ "value": 161
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/input.js
index e5543066d000..8e1c3c4399a1 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/input.js
@@ -1 +1 @@
-0x_a_1,
+0x_a_1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json
new file mode 100644
index 000000000000..a70fc4a0fa0f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0x_a_1"
+ },
+ "value": 161
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/input.js
index 68e6a0d63fea..d8039a473eb0 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/input.js
@@ -1 +1 @@
-0x__1_1_,
+0x__1_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json
new file mode 100644
index 000000000000..b75b68e18c5f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json
@@ -0,0 +1,112 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x__1_1_"
+ },
+ "value": 17
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/input.js
index fd959c9609a9..3853dd5ba743 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/input.js
@@ -1 +1 @@
-0x_1__1,
+0x_1__1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json
new file mode 100644
index 000000000000..7ddf567a2967
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json
@@ -0,0 +1,112 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1__1"
+ },
+ "value": 17
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/input.js
index dc2301a00ea7..90213eb4c896 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/input.js
@@ -1 +1 @@
-0x_1_1_,
+0x_1_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json
new file mode 100644
index 000000000000..849bdb6de9a8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json
@@ -0,0 +1,111 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1_1_"
+ },
+ "value": 17
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/input.js
index 3a7f53b8dc81..56f62d261b65 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/input.js
@@ -1 +1 @@
-0o_1_1,
+0o_1_1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json
new file mode 100644
index 000000000000..112bef72c91a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1"
+ },
+ "value": 9
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/input.js
index ed870aa937cd..fe56d1a3c36d 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/input.js
@@ -1 +1 @@
-0o_11,
+0o_11, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json
new file mode 100644
index 000000000000..e702d612d243
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_11"
+ },
+ "value": 9
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json
new file mode 100644
index 000000000000..13d9caf030b8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_E1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/input.js
index e9fcb15ff998..d395282140ef 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/input.js
@@ -1 +1 @@
-0o_01_1_,
+0o_01_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json
new file mode 100644
index 000000000000..5f86cf161b9a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json
@@ -0,0 +1,111 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_01_1_"
+ },
+ "value": 9
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/input.js
index 86cc54d9ed2d..4f5cb5c1e06b 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/input.js
@@ -1 +1 @@
-0b_0_1_1,
+0b_0_1_1, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json
new file mode 100644
index 000000000000..5ce3d7e5f1db
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_0_1_1"
+ },
+ "value": 3
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/input.js
index 0c52a13346c0..1589fddd67c3 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/input.js
@@ -1 +1 @@
-0b_01_1_,
+0b_01_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json
new file mode 100644
index 000000000000..3364a2a11b7b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json
@@ -0,0 +1,111 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_01_1_"
+ },
+ "value": 3
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/input.js
index 95c45fd025be..c730763e66fa 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/input.js
@@ -1 +1 @@
-0b01_1_,
+0b01_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json
new file mode 100644
index 000000000000..77046a4ee17f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b01_1_"
+ },
+ "value": 3
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/input.js
index 58ff35dd6c36..3a3aa0484726 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/input.js
@@ -1 +1 @@
-0o1_1_,
+0o1_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json
new file mode 100644
index 000000000000..fdc0933003a0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json
@@ -0,0 +1,110 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o1_1_"
+ },
+ "value": 9
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/input.js
index bd44d425a6fa..a4d36757d478 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/input.js
@@ -1 +1 @@
-0o_1_1_,
+0o_1_1_, 0
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json
new file mode 100644
index 000000000000..7f14d41f530d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json
@@ -0,0 +1,111 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1_"
+ },
+ "value": 9
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json
new file mode 100644
index 000000000000..f505cbb81666
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1_"
+ },
+ "value": 1
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json
new file mode 100644
index 000000000000..2648664f298c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1_"
+ },
+ "value": 11
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json
new file mode 100644
index 000000000000..a270c2420610
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1_1__"
+ },
+ "value": 11
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/options.json
deleted file mode 100644
index 8cb6bf4866a3..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:2)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json
new file mode 100644
index 000000000000..650a98a4cbff
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:2)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 11,
+ "raw": "1__1"
+ },
+ "value": 11
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json
new file mode 100644
index 000000000000..037c60cbef6f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1e_1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/options.json
deleted file mode 100644
index 91c5decd9c42..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:4)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json
new file mode 100644
index 000000000000..1410809bebec
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1_.1_1"
+ },
+ "value": 11.11
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/options.json
deleted file mode 100644
index a65e1ff322a7..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:5)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json
new file mode 100644
index 000000000000..5ac0337bfe64
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 11.11,
+ "raw": "1_1._1_1"
+ },
+ "value": 11.11
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json
new file mode 100644
index 000000000000..417003e07eaa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_e1"
+ },
+ "value": 111
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json
new file mode 100644
index 000000000000..9aa4e5c834d8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1_E1"
+ },
+ "value": 111
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json
new file mode 100644
index 000000000000..859e6d5d5325
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1e_1"
+ },
+ "value": 111
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json
new file mode 100644
index 000000000000..5020300be097
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1E_1"
+ },
+ "value": 111
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json
new file mode 100644
index 000000000000..3f132f054796
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x1_1_"
+ },
+ "value": 17
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json
new file mode 100644
index 000000000000..173a126235b1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0xa_1_"
+ },
+ "value": 161
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json
new file mode 100644
index 000000000000..4f7277b6d914
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 161,
+ "raw": "0x_a_1"
+ },
+ "value": 161
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json
new file mode 100644
index 000000000000..1e5f3a747c34
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json
@@ -0,0 +1,92 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:4)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x__1_1_"
+ },
+ "value": 17
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json
new file mode 100644
index 000000000000..ea1d5804721a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 111,
+ "raw": "1_1.1E_1"
+ },
+ "value": 111
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json
new file mode 100644
index 000000000000..9723cfbd4fda
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json
@@ -0,0 +1,92 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:5)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1__1"
+ },
+ "value": 17
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json
new file mode 100644
index 000000000000..e802a59e0737
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 17,
+ "raw": "0x_1_1_"
+ },
+ "value": 17
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json
new file mode 100644
index 000000000000..ffc792a8db4d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1"
+ },
+ "value": 9
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json
new file mode 100644
index 000000000000..583643ac786d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_11"
+ },
+ "value": 9
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json
new file mode 100644
index 000000000000..71984f0f6d53
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_01_1_"
+ },
+ "value": 9
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json
new file mode 100644
index 000000000000..92169c50ab72
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_0_1_1"
+ },
+ "value": 3
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json
new file mode 100644
index 000000000000..8775652f6e4e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b_01_1_"
+ },
+ "value": 3
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/options.json
deleted file mode 100644
index badcb4c1b655..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:7)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json
new file mode 100644
index 000000000000..8427ff4fefb2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "0b01_1_"
+ },
+ "value": 3
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/options.json
deleted file mode 100644
index 9c49308645fd..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:6)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json
new file mode 100644
index 000000000000..ab96b90e5fb1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json
@@ -0,0 +1,90 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o1_1_"
+ },
+ "value": 9
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/options.json
deleted file mode 100644
index 477511a87822..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "throws": "Invalid or unexpected token (1:3)" }
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json
new file mode 100644
index 000000000000..a3925ad6c8e8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: A numeric separator is only allowed between two digits (1:3)",
+ "SyntaxError: A numeric separator is only allowed between two digits (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "elements": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 9,
+ "raw": "0o_1_1_"
+ },
+ "value": 9
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json
index fd0b1c7f0a7d..45b66a114bf9 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json
@@ -1 +1,6 @@
-{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:4)" }
+{
+ "plugins": [
+ "bigInt",
+ "numericSeparator"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json
new file mode 100644
index 000000000000..f47a3612a995
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "\\x1_0",
+ "extra": {
+ "raw": "\"\\x1_0\"",
+ "rawValue": "\\x1_0"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json
index 57c99a94dbd6..45b66a114bf9 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json
@@ -1 +1,6 @@
-{ "throws": "Numeric separator can not be used after leading 0 (1:1)" }
+{
+ "plugins": [
+ "bigInt",
+ "numericSeparator"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json
new file mode 100644
index 000000000000..b9271342b1f5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "errors": [
+ "SyntaxError: Numeric separator can not be used after leading 0 (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "extra": {
+ "rawValue": 8,
+ "raw": "0_8"
+ },
+ "value": 8
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json
index 5a4fb4525d02..45b66a114bf9 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json
@@ -1 +1,6 @@
-{ "throws": "Numeric separator can not be used after leading 0 (1:2)" }
+{
+ "plugins": [
+ "bigInt",
+ "numericSeparator"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json
new file mode 100644
index 000000000000..9677b88e4b27
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Numeric separator can not be used after leading 0 (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "00_0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json
index 5a4fb4525d02..45b66a114bf9 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json
@@ -1 +1,6 @@
-{ "throws": "Numeric separator can not be used after leading 0 (1:2)" }
+{
+ "plugins": [
+ "bigInt",
+ "numericSeparator"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json
new file mode 100644
index 000000000000..da24fe2bdd7d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json
@@ -0,0 +1,74 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Numeric separator can not be used after leading 0 (1:2)",
+ "SyntaxError: Invalid BigIntLiteral (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "BigIntLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": "080",
+ "raw": "08_0n"
+ },
+ "value": "080"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json
index ca0ceaeaaea6..45b66a114bf9 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json
@@ -1 +1,6 @@
-{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:5)" }
+{
+ "plugins": [
+ "bigInt",
+ "numericSeparator"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json
new file mode 100644
index 000000000000..b3d5564b9494
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "\\u12_34",
+ "extra": {
+ "raw": "\"\\u12_34\"",
+ "rawValue": "\\u12_34"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json
index e42d95d86acf..45b66a114bf9 100644
--- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json
@@ -1 +1,6 @@
-{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:6)" }
+{
+ "plugins": [
+ "bigInt",
+ "numericSeparator"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json
new file mode 100644
index 000000000000..e30a6e6b7370
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [],
+ "directives": [
+ {
+ "type": "Directive",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "type": "DirectiveLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": "\\u{1F_639}",
+ "extra": {
+ "raw": "\"\\u{1F_639}\"",
+ "rawValue": "\\u{1F_639}"
+ }
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json
index ed5e3c16bf68..0011d898807d 100644
--- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["optionalChaining"],
- "throws": "constructors in/after an Optional Chain are not allowed (1:10)"
-}
+ "plugins": [
+ "optionalChaining"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json
new file mode 100644
index 000000000000..8ecf52133d5f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: constructors in/after an Optional Chain are not allowed (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "NewExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "callee": {
+ "type": "OptionalMemberExpression",
+ "start": 4,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "object": {
+ "type": "OptionalMemberExpression",
+ "start": 4,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "optional": true
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "d"
+ },
+ "name": "d"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json
index 10cef4d48073..0011d898807d 100644
--- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["optionalChaining"],
- "throws": "constructors in/after an Optional Chain are not allowed (1:7)"
-}
+ "plugins": [
+ "optionalChaining"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json
new file mode 100644
index 000000000000..6c643fbdd8ab
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json
@@ -0,0 +1,86 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: constructors in/after an Optional Chain are not allowed (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "NewExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "arguments": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json
index 86849e8c464a..fd201c1bdb02 100644
--- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json
@@ -1,4 +1,3 @@
{
- "plugins": ["optionalChaining"],
- "throws": "Unexpected token (3:20)"
+ "plugins": ["optionalChaining"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json
new file mode 100644
index 000000000000..1f9545412a7a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json
@@ -0,0 +1,209 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 7,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 13,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 16,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ },
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 26,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "argument": {
+ "type": "OptionalMemberExpression",
+ "start": 33,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "object": {
+ "type": "Super",
+ "start": 33,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "optional": true
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json
index 86849e8c464a..fd201c1bdb02 100644
--- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json
@@ -1,4 +1,3 @@
{
- "plugins": ["optionalChaining"],
- "throws": "Unexpected token (3:20)"
+ "plugins": ["optionalChaining"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json
new file mode 100644
index 000000000000..548b5c32d5a7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json
@@ -0,0 +1,226 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 10,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 16,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ },
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 29,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "argument": {
+ "type": "OptionalMemberExpression",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "object": {
+ "type": "Super",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ },
+ "computed": false,
+ "optional": true
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json
index 631741b044e0..0011d898807d 100644
--- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["optionalChaining"],
- "throws": "Tagged Template Literals are not allowed in optionalChain (1:0)"
-}
+ "plugins": [
+ "optionalChaining"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json
new file mode 100644
index 000000000000..9dff15f15eda
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json
@@ -0,0 +1,157 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Tagged Template Literals are not allowed in optionalChain (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "TaggedTemplateExpression",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "tag": {
+ "type": "OptionalMemberExpression",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": false,
+ "optional": true
+ },
+ "quasi": {
+ "type": "TemplateLiteral",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": {
+ "raw": "foo",
+ "cooked": "foo"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/options.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/options.json
index 58192a87fd99..982b7cd1dab5 100644
--- a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["partialApplication"],
- "throws": "Unexpected argument placeholder (3:16)"
-}
+ "plugins": [
+ "partialApplication"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json
new file mode 100644
index 000000000000..14f531a7e147
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json
@@ -0,0 +1,390 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected argument placeholder (3:16)",
+ "SyntaxError: Unexpected argument placeholder (3:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "Bar"
+ },
+ "name": "Bar"
+ },
+ "body": {
+ "type": "ClassBody",
+ "start": 22,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 26,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 40,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 46,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 46,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "callee": {
+ "type": "Super",
+ "start": 46,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "start": 52,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 55,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ {
+ "type": "ArgumentPlaceholder",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ }
+ },
+ {
+ "type": "ArgumentPlaceholder",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 69,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 69,
+ "end": 79,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "MemberExpression",
+ "start": 69,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "object": {
+ "type": "ThisExpression",
+ "start": 69,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 74,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 78,
+ "end": 79,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/options.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/options.json
index 3b09c84c03eb..982b7cd1dab5 100644
--- a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/options.json
@@ -1,4 +1,5 @@
{
- "plugins": ["partialApplication"],
- "throws": "Unexpected argument placeholder (1:11)"
-}
+ "plugins": [
+ "partialApplication"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json
new file mode 100644
index 000000000000..d12380e4820c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json
@@ -0,0 +1,155 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected argument placeholder (1:11)",
+ "SyntaxError: Unexpected argument placeholder (1:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "NewExpression",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ {
+ "type": "ArgumentPlaceholder",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ },
+ {
+ "type": "ArgumentPlaceholder",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/options.json
index cc2c16a778e7..abf908b86e3e 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/options.json
@@ -1,4 +1,10 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline head should not be a comma-separated sequence expression (1:0)"
-}
+ "plugins": [
+ [
+ "pipelineOperator",
+ {
+ "proposal": "smart"
+ }
+ ]
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json
new file mode 100644
index 000000000000..b06186702668
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline head should not be a comma-separated sequence expression (1:0)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "left": {
+ "type": "SequenceExpression",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "extra": {
+ "rawValue": 2,
+ "raw": "2"
+ },
+ "value": 2
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineBareFunction",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/options.json
index d2b32f77521a..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:5)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json
new file mode 100644
index 000000000000..9aceb13325af
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json
@@ -0,0 +1,207 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 5,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 6,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "$"
+ },
+ "name": "$"
+ }
+ ],
+ "body": {
+ "type": "BinaryExpression",
+ "start": 11,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "$"
+ },
+ "name": "$"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineBareFunction",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ }
+ }
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 5
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/options.json
index e9eab6b46fe9..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:16)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json
new file mode 100644
index 000000000000..a4b95926f362
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json
@@ -0,0 +1,241 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 5,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 6,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "$"
+ },
+ "name": "$"
+ }
+ ],
+ "body": {
+ "type": "BinaryExpression",
+ "start": 11,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "left": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "$"
+ },
+ "name": "$"
+ },
+ "operator": "+",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ }
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 5
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/options.json
index d2b32f77521a..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:5)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json
new file mode 100644
index 000000000000..257c98280e2e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json
@@ -0,0 +1,205 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 5,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 6,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "$"
+ },
+ "name": "$"
+ }
+ ],
+ "body": {
+ "type": "BinaryExpression",
+ "start": 11,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "$"
+ },
+ "name": "$"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expression": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ }
+ }
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 5
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/options.json
index bdf0547df8f9..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:11)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json
new file mode 100644
index 000000000000..5644ff01406b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json
@@ -0,0 +1,184 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 5,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 6,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "left": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "arguments": []
+ }
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 5
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/options.json
index d2b32f77521a..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:5)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json
new file mode 100644
index 000000000000..f274dbc1ad48
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json
@@ -0,0 +1,170 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 5,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 6,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "$"
+ },
+ "name": "$"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineBareFunction",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ }
+ },
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 5
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/options.json
index fe3873ecc67f..abf908b86e3e 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/options.json
@@ -1,4 +1,10 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline body may not be a comma-separated sequence expression (1:6)"
-}
+ "plugins": [
+ [
+ "pipelineOperator",
+ {
+ "proposal": "smart"
+ }
+ ]
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json
new file mode 100644
index 000000000000..b0b8ec5955df
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json
@@ -0,0 +1,203 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline body may not be a comma-separated sequence expression (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "left": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "left": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 6,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 6
+ }
+ }
+ }
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineBareFunction",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "h"
+ },
+ "name": "h"
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json
index fe3873ecc67f..abf908b86e3e 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json
@@ -1,4 +1,10 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline body may not be a comma-separated sequence expression (1:6)"
-}
+ "plugins": [
+ [
+ "pipelineOperator",
+ {
+ "proposal": "smart"
+ }
+ ]
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json
new file mode 100644
index 000000000000..89c673d0bc0c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json
@@ -0,0 +1,155 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline body may not be a comma-separated sequence expression (1:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "left": {
+ "type": "NumericLiteral",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ },
+ "extra": {
+ "rawValue": 10,
+ "raw": "10"
+ },
+ "value": 10
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 6,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 7,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expressions": [
+ {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 6
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json
index 7a4451381c91..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:9)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json
new file mode 100644
index 000000000000..feca14ebaf5b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json
@@ -0,0 +1,151 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "computed": true
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json
index 7a4451381c91..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:9)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json
new file mode 100644
index 000000000000..c1399c71afa2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json
@@ -0,0 +1,151 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "operator": "+",
+ "right": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json
index 7a4451381c91..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:9)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json
new file mode 100644
index 000000000000..da79f8d294e8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "ClassExpression",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": null,
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "body": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json
index 7a4451381c91..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Pipeline is in topic style but does not use topic reference (1:9)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json
new file mode 100644
index 000000000000..63e37b46042d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "errors": [
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 9,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 22,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 24,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "argument": null
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/input.js
index c1005576b7d5..8b34c84f521f 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/input.js
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/input.js
@@ -1 +1 @@
-value |> do { do x += # while (x < 50); }
+value |> do { do x += #; while (x < 50); }
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/options.json
index 3b7a52d71cf7..edb7679c6a74 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"],
- "throws": "Topic reference was used in a lexical context without topic binding (1:22)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json
new file mode 100644
index 000000000000..95125a326a21
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json
@@ -0,0 +1,266 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:22)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "DoExpression",
+ "start": 9,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "body": [
+ {
+ "type": "DoWhileStatement",
+ "start": 14,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 17,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 17,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "operator": "+=",
+ "left": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ }
+ }
+ },
+ "test": {
+ "type": "BinaryExpression",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "<",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 36,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "extra": {
+ "rawValue": 50,
+ "raw": "50"
+ },
+ "value": 50
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/options.json
index d117d235099d..680f780892b7 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/options.json
@@ -3,6 +3,5 @@
["pipelineOperator", { "proposal": "smart" }],
"doExpressions",
"asyncGenerators"
- ],
- "throws": "Topic reference was used in a lexical context without topic binding (2:48)"
+ ]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json
new file mode 100644
index 000000000000..372a871e8b7b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json
@@ -0,0 +1,302 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (2:48)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "af"
+ },
+ "name": "af"
+ },
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 25,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 25,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 34,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "expression": {
+ "type": "DoExpression",
+ "start": 34,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 37,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 39,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "await": true,
+ "left": {
+ "type": "VariableDeclaration",
+ "start": 50,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 56,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 56,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ },
+ "identifierName": "e"
+ },
+ "name": "e"
+ },
+ "init": null
+ }
+ ],
+ "kind": "const"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 46
+ },
+ "identifierName": "sequence"
+ },
+ "name": "sequence"
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 71,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 48
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "expression": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 71,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 48
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/options.json
index 35e8658a93da..edb7679c6a74 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"],
- "throws": "Topic reference was used in a lexical context without topic binding (1:45)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json
new file mode 100644
index 000000000000..58ca8064b581
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json
@@ -0,0 +1,353 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:45)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "expression": {
+ "type": "DoExpression",
+ "start": 9,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 49
+ }
+ },
+ "body": [
+ {
+ "type": "ForStatement",
+ "start": 14,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "init": {
+ "type": "VariableDeclaration",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ "test": {
+ "type": "BinaryExpression",
+ "start": 30,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "operator": "<",
+ "right": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ },
+ "identifierName": "n"
+ },
+ "name": "n"
+ }
+ },
+ "update": {
+ "type": "AssignmentExpression",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "operator": "+=",
+ "left": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 37
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ },
+ "identifierName": "i"
+ },
+ "name": "i"
+ },
+ "right": {
+ "type": "NumericLiteral",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 45,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 1,
+ "column": 47
+ }
+ },
+ "expression": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 45,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/options.json
index 6e8b4a6f0d95..edb7679c6a74 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"],
- "throws": "Topic reference was used in a lexical context without topic binding (1:32)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json
new file mode 100644
index 000000000000..6f197479125e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json
@@ -0,0 +1,214 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:32)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "DoExpression",
+ "start": 9,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "body": [
+ {
+ "type": "ForInStatement",
+ "start": 14,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "e"
+ },
+ "name": "e"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "object"
+ },
+ "name": "object"
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 32,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/options.json
index a3707cc91710..edb7679c6a74 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"],
- "throws": "Topic reference was used in a lexical context without topic binding (1:34)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json
new file mode 100644
index 000000000000..b4bdcb7bcd7d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json
@@ -0,0 +1,215 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:34)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "DoExpression",
+ "start": 9,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": [
+ {
+ "type": "ForOfStatement",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "await": false,
+ "left": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "e"
+ },
+ "name": "e"
+ },
+ "right": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ },
+ "identifierName": "sequence"
+ },
+ "name": "sequence"
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/options.json
index 0f40a90d2204..edb7679c6a74 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"],
- "throws": "Topic reference was used in a lexical context without topic binding (3:32)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json
new file mode 100644
index 000000000000..f168982f9d91
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json
@@ -0,0 +1,412 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (3:32)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "expression": {
+ "type": "DoExpression",
+ "start": 9,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "TryStatement",
+ "start": 16,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "block": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 22,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 22,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "callee": {
+ "type": "MemberExpression",
+ "start": 22,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "JSON"
+ },
+ "name": "JSON"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "parse"
+ },
+ "name": "parse"
+ },
+ "computed": false
+ },
+ "arguments": [
+ {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ },
+ "handler": {
+ "type": "CatchClause",
+ "start": 41,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "param": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ },
+ "identifierName": "error"
+ },
+ "name": "error"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 55,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 57,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 57,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "callee": {
+ "type": "MemberExpression",
+ "start": 57,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "object": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "identifierName": "console"
+ },
+ "name": "console"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 65,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ },
+ "identifierName": "error"
+ },
+ "name": "error"
+ },
+ "computed": false
+ },
+ "arguments": [
+ {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 71,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+ },
+ "finalizer": null
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/options.json
index a3707cc91710..edb7679c6a74 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"],
- "throws": "Topic reference was used in a lexical context without topic binding (1:34)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json
new file mode 100644
index 000000000000..899a06650593
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json
@@ -0,0 +1,266 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:34)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "DoExpression",
+ "start": 9,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": [
+ {
+ "type": "WhileStatement",
+ "start": 14,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "test": {
+ "type": "BinaryExpression",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "<",
+ "right": {
+ "type": "NumericLiteral",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "extra": {
+ "rawValue": 50,
+ "raw": "50"
+ },
+ "value": 50
+ }
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 29,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 29,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "operator": "+=",
+ "left": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "right": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/options.json
index fee1ffebc044..edb7679c6a74 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"],
- "throws": "Topic reference was used in a lexical context without topic binding (1:24)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json
new file mode 100644
index 000000000000..a185b5983604
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json
@@ -0,0 +1,196 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:24)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "value"
+ },
+ "name": "value"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 9,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "DoExpression",
+ "start": 9,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "body": [
+ {
+ "type": "WithStatement",
+ "start": 14,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "object": {
+ "type": "ObjectExpression",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "properties": []
+ },
+ "body": {
+ "type": "ExpressionStatement",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "expression": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/options.json
index 6401af97db12..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Topic reference was used in a lexical context without topic binding (1:39)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json
new file mode 100644
index 000000000000..64fb49d7358b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json
@@ -0,0 +1,287 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:39)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 5,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "expression": {
+ "type": "ClassExpression",
+ "start": 5,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "id": null,
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 11,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 13,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 28,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 30,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 30,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "operator": "=",
+ "left": {
+ "type": "MemberExpression",
+ "start": 30,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "object": {
+ "type": "ThisExpression",
+ "start": 30,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "computed": false
+ },
+ "right": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json
index e6731253189f..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Topic reference was used in a lexical context without topic binding (1:19)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json
new file mode 100644
index 000000000000..df16ab34e48b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json
@@ -0,0 +1,169 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:19)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 5,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 5,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json
index e6731253189f..17e4e327bbad 100644
--- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["pipelineOperator", { "proposal": "smart" }]],
- "throws": "Topic reference was used in a lexical context without topic binding (1:19)"
+ "plugins": [["pipelineOperator", { "proposal": "smart" }]]
}
diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json
new file mode 100644
index 000000000000..0023723944ac
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json
@@ -0,0 +1,215 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:19)",
+ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 1,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 5,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 5,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 19,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 19,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "left": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ },
+ "operator": "|>",
+ "right": {
+ "type": "PipelineTopicExpression",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "PipelinePrimaryTopicReference",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json
new file mode 100644
index 000000000000..f2d99c02f8f3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\01",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json
new file mode 100644
index 000000000000..84ac3db2b3e5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\xg",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json
new file mode 100644
index 000000000000..ad1bda1a1fbc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "\\xg",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json
new file mode 100644
index 000000000000..5c60a91a9482
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "\\xg",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json
new file mode 100644
index 000000000000..76b845845cea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "\\xAg",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json
new file mode 100644
index 000000000000..6dd7932c623a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "\\xAg",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json
new file mode 100644
index 000000000000..46ca5191adb2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "\\xAg",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json
new file mode 100644
index 000000000000..b050c973d652
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "\\xAg",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json
new file mode 100644
index 000000000000..5876338e6e3c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\u0",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json
new file mode 100644
index 000000000000..ab51dae8c74a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\u0",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json
new file mode 100644
index 000000000000..7e0fe1f7af88
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "\\u0",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json
new file mode 100644
index 000000000000..05034cfa43af
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\01",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json
new file mode 100644
index 000000000000..4daf639555aa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "\\u0",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json
new file mode 100644
index 000000000000..93487dccb244
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "\\u0g",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json
new file mode 100644
index 000000000000..d90c680f758c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "\\u0g",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json
new file mode 100644
index 000000000000..11b9589834ce
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "\\u0g",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json
new file mode 100644
index 000000000000..aef068ff0dcb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "\\u0g",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json
new file mode 100644
index 000000000000..83c602cde696
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "raw": "\\u00g",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json
new file mode 100644
index 000000000000..b775d5821aeb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "raw": "\\u00g",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 10,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json
new file mode 100644
index 000000000000..7bfe8f7bc378
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "\\u00g",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json
new file mode 100644
index 000000000000..b148595b1c8c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "\\u00g",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json
new file mode 100644
index 000000000000..b0e6a55f8b9d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": {
+ "raw": "\\u000g",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json
new file mode 100644
index 000000000000..0d3190ef7f95
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "\\01",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json
new file mode 100644
index 000000000000..a7b5e0bd1bfd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": {
+ "raw": "\\u000g",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json
new file mode 100644
index 000000000000..ac3a71555369
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "\\u000g",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json
new file mode 100644
index 000000000000..5163754673d0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "\\u000g",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 19,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json
new file mode 100644
index 000000000000..2273b5e141cf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "\\u{}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json
new file mode 100644
index 000000000000..fecd37e4b169
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "\\u{}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json
new file mode 100644
index 000000000000..83150d31dec6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "\\u{}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json
new file mode 100644
index 000000000000..f5d1e7ad2ec7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "\\u{}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json
new file mode 100644
index 000000000000..1f51bd46894e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": {
+ "raw": "\\u{-0}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json
new file mode 100644
index 000000000000..2654eccc8ca8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": {
+ "raw": "\\u{-0}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 11,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json
new file mode 100644
index 000000000000..b3b301d701b4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "\\u{-0}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json
new file mode 100644
index 000000000000..1d30df1fa402
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "\\01",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json
new file mode 100644
index 000000000000..124c7c8c9d41
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "\\u{-0}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 19,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json
new file mode 100644
index 000000000000..e22b35045789
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "raw": "\\u{g}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json
new file mode 100644
index 000000000000..e25755bdf0c5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "raw": "\\u{g}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 10,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json
new file mode 100644
index 000000000000..3dfeb7480fa4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "\\u{g}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json
new file mode 100644
index 000000000000..8da7d9e51bdf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "\\u{g}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json
new file mode 100644
index 000000000000..07b00d61949a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\u{",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json
new file mode 100644
index 000000000000..b03d29b7821a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\u{",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json
new file mode 100644
index 000000000000..dab814bd833d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "\\u{",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json
new file mode 100644
index 000000000000..28b0d47818c9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "\\u{",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json
new file mode 100644
index 000000000000..0c1f9bcd5045
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "raw": "\\u{\\\\",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json
new file mode 100644
index 000000000000..6ce800288f9a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "value": {
+ "raw": "\\1",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json
new file mode 100644
index 000000000000..2e283e2f77c8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "raw": "\\u{\\\\",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 10,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json
new file mode 100644
index 000000000000..151b718a43f4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "\\u{\\\\",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json
new file mode 100644
index 000000000000..0ca0c69ed03d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "\\u{\\\\",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json
new file mode 100644
index 000000000000..eb1dc9edcf28
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "raw": "\\u{\\`",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json
new file mode 100644
index 000000000000..a0df02ed0394
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": {
+ "raw": "\\u{\\`",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 10,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json
new file mode 100644
index 000000000000..b757f165c1ee
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "\\u{\\`",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json
new file mode 100644
index 000000000000..8ee240a36baf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "\\u{\\`",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 18,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json
new file mode 100644
index 000000000000..1450743b5caa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "\\u{0",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json
new file mode 100644
index 000000000000..24b6f69d7f38
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "\\u{0",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json
new file mode 100644
index 000000000000..26af843c60e5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "\\u{0",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json
new file mode 100644
index 000000000000..cf4eef5577aa
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "value": {
+ "raw": "\\1",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 7,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json
new file mode 100644
index 000000000000..ad94447a587d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": {
+ "raw": "\\u{0",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json
new file mode 100644
index 000000000000..c1f7f255feb4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": {
+ "raw": "\\u{\\u{0}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json
new file mode 100644
index 000000000000..5782d9c9baef
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": {
+ "raw": "\\u{\\u{0}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 13,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json
new file mode 100644
index 000000000000..2c3d41a7a407
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "value": {
+ "raw": "\\u{\\u{0}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json
new file mode 100644
index 000000000000..4dccbdb5cd3d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "value": {
+ "raw": "\\u{\\u{0}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 21,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json
new file mode 100644
index 000000000000..ae5fba46a8cd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": {
+ "raw": "\\u{110000}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json
new file mode 100644
index 000000000000..ea93f11c4126
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": {
+ "raw": "\\u{110000}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json
new file mode 100644
index 000000000000..a37b45899de0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": {
+ "raw": "\\u{110000}",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json
new file mode 100644
index 000000000000..22154057933d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": {
+ "raw": "\\u{110000}",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json
new file mode 100644
index 000000000000..ce27b82a7d1e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": {
+ "raw": "\\1",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json
deleted file mode 100644
index 27524e2b1f49..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json
new file mode 100644
index 000000000000..81d9e807fc24
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expressions": [
+ {
+ "type": "NumericLiteral",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "extra": {
+ "rawValue": 0,
+ "raw": "0"
+ },
+ "value": 0
+ },
+ {
+ "type": "NumericLiteral",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": {
+ "raw": "left",
+ "cooked": "left"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": {
+ "raw": "\\1",
+ "cooked": null
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "value": {
+ "raw": "right",
+ "cooked": "right"
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json
deleted file mode 100644
index fd4da953a419..000000000000
--- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid escape sequence in template (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json
new file mode 100644
index 000000000000..67d2c1d0b2d0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json
@@ -0,0 +1,91 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid escape sequence in template (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "TemplateLiteral",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "value": {
+ "raw": "\\xg",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json
index 95eb740f8dfb..64cfc06e5014 100644
--- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json
@@ -1,5 +1,6 @@
{
"plugins": ["topLevelAwait"],
"sourceType": "module",
+ "errorRecovery": false,
"throws": "Can not use keyword 'await' outside an async function (1:6)"
}
diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json
index d09f3f654766..8eade50d15b5 100644
--- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json
+++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json
@@ -1,5 +1,6 @@
{
"plugins": ["topLevelAwait"],
"sourceType": "module",
+ "errorRecovery": false,
"throws": "Can not use keyword 'await' outside an async function (2:2)"
}
diff --git a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/options.json b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/options.json
index 382ffd0c6970..493880101c16 100644
--- a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/options.json
+++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/options.json
@@ -1,4 +1,8 @@
{
- "throws": "Classes may not have a field named 'constructor' (2:2)",
- "plugins": ["jsx", "flow", "classProperties"]
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow",
+ "classProperties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json
new file mode 100644
index 000000000000..3d9ad56d93cd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json
@@ -0,0 +1,172 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Classes may not have a field named 'constructor' (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 10,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 14,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "variance": null,
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 25,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "typeAnnotation": {
+ "type": "FunctionTypeAnnotation",
+ "start": 27,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "params": [],
+ "rest": null,
+ "returnType": {
+ "type": "ThisTypeAnnotation",
+ "start": 33,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ }
+ },
+ "typeParameters": null
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/options.json b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/options.json
deleted file mode 100644
index 9a7e0e3402af..000000000000
--- a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unterminated flow-comment (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json
new file mode 100644
index 000000000000..bd82aabe61e4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json
@@ -0,0 +1,73 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "errors": [
+ "SyntaxError: Unterminated flow-comment (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [],
+ "directives": [],
+ "innerComments": [
+ {
+ "type": "CommentLine",
+ "value": "asd */",
+ "start": 5,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ }
+ ]
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "asd */",
+ "start": 5,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json
deleted file mode 100644
index adfde3236356..000000000000
--- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:55)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json
new file mode 100644
index 000000000000..43cb8ee092f2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json
@@ -0,0 +1,214 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 87
+ }
+ },
+ "errors": [
+ "SyntaxError: Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:55)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 87
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareModule",
+ "start": 0,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 87
+ }
+ },
+ "id": {
+ "type": "StringLiteral",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 87
+ }
+ },
+ "body": [
+ {
+ "type": "DeclareModuleExports",
+ "start": 23,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 45,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "typeAnnotation": {
+ "type": "NumberTypeAnnotation",
+ "start": 47,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "DeclareExportDeclaration",
+ "start": 55,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 55
+ },
+ "end": {
+ "line": 1,
+ "column": 84
+ }
+ },
+ "declaration": {
+ "type": "DeclareVariable",
+ "start": 70,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 70
+ },
+ "end": {
+ "line": 1,
+ "column": 84
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 74,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 74
+ },
+ "end": {
+ "line": 1,
+ "column": 83
+ },
+ "identifierName": "a"
+ },
+ "name": "a",
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 75,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 75
+ },
+ "end": {
+ "line": 1,
+ "column": 83
+ }
+ },
+ "typeAnnotation": {
+ "type": "NumberTypeAnnotation",
+ "start": 77,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 77
+ },
+ "end": {
+ "line": 1,
+ "column": 83
+ }
+ }
+ }
+ }
+ }
+ },
+ "default": false
+ }
+ ]
+ },
+ "kind": "ES"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/options.json
deleted file mode 100644
index b40239a5609c..000000000000
--- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:53)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json
new file mode 100644
index 000000000000..536157fab722
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json
@@ -0,0 +1,214 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 86
+ }
+ },
+ "errors": [
+ "SyntaxError: Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:53)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 86
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareModule",
+ "start": 0,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 86
+ }
+ },
+ "id": {
+ "type": "StringLiteral",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 86
+ }
+ },
+ "body": [
+ {
+ "type": "DeclareExportDeclaration",
+ "start": 23,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "declaration": {
+ "type": "DeclareVariable",
+ "start": 38,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 1,
+ "column": 52
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 42,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ },
+ "identifierName": "a"
+ },
+ "name": "a",
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 43,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 43
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ },
+ "typeAnnotation": {
+ "type": "NumberTypeAnnotation",
+ "start": 45,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 1,
+ "column": 51
+ }
+ }
+ }
+ }
+ }
+ },
+ "default": false
+ },
+ {
+ "type": "DeclareModuleExports",
+ "start": 53,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 53
+ },
+ "end": {
+ "line": 1,
+ "column": 84
+ }
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 75,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 75
+ },
+ "end": {
+ "line": 1,
+ "column": 83
+ }
+ },
+ "typeAnnotation": {
+ "type": "NumberTypeAnnotation",
+ "start": 77,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 77
+ },
+ "end": {
+ "line": 1,
+ "column": 83
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "kind": "CommonJS"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/options.json
deleted file mode 100644
index c237bb99a73b..000000000000
--- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Imports within a `declare module` body must always be `import type` or `import typeof` (1:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json
new file mode 100644
index 000000000000..2d33b963c778
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "errors": [
+ "SyntaxError: Imports within a `declare module` body must always be `import type` or `import typeof` (1:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareModule",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "id": {
+ "type": "StringLiteral",
+ "start": 15,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "extra": {
+ "rawValue": "M",
+ "raw": "\"M\""
+ },
+ "value": "M"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 19,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 21,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ }
+ }
+ ],
+ "importKind": "value",
+ "source": {
+ "type": "StringLiteral",
+ "start": 35,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "extra": {
+ "rawValue": "TM",
+ "raw": "\"TM\""
+ },
+ "value": "TM"
+ }
+ }
+ ]
+ },
+ "kind": "CommonJS"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/options.json
deleted file mode 100644
index cd823bd7c4e0..000000000000
--- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "`declare module` cannot be used inside another `declare module` (1:27)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json
new file mode 100644
index 000000000000..0a3fe70d8611
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "errors": [
+ "SyntaxError: `declare module` cannot be used inside another `declare module` (1:27)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareModule",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "body": [
+ {
+ "type": "DeclareModule",
+ "start": 19,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "body": []
+ },
+ "kind": "CommonJS"
+ }
+ ]
+ },
+ "kind": "CommonJS"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json
deleted file mode 100644
index 1520d766b062..000000000000
--- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Duplicate `declare module.exports` statement (1:55)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json
new file mode 100644
index 000000000000..4339f6dbf5c6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json
@@ -0,0 +1,181 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 88,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 88
+ }
+ },
+ "errors": [
+ "SyntaxError: Duplicate `declare module.exports` statement (1:55)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 88,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 88
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareModule",
+ "start": 0,
+ "end": 88,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 88
+ }
+ },
+ "id": {
+ "type": "StringLiteral",
+ "start": 15,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 21,
+ "end": 88,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 88
+ }
+ },
+ "body": [
+ {
+ "type": "DeclareModuleExports",
+ "start": 23,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 45,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 47,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 47
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "DeclareModuleExports",
+ "start": 55,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 55
+ },
+ "end": {
+ "line": 1,
+ "column": 86
+ }
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 77,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 77
+ },
+ "end": {
+ "line": 1,
+ "column": 85
+ }
+ },
+ "typeAnnotation": {
+ "type": "NumberTypeAnnotation",
+ "start": 79,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 79
+ },
+ "end": {
+ "line": 1,
+ "column": 85
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "kind": "CommonJS"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json
index b3b5dfd8b08f..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json
new file mode 100644
index 000000000000..8ca6221bd05f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumBooleanBody",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "explicitType": true,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json
index b3b5dfd8b08f..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json
new file mode 100644
index 000000000000..de57afc78eea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json
@@ -0,0 +1,136 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumBooleanBody",
+ "start": 11,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumBooleanMember",
+ "start": 16,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "BooleanLiteral",
+ "start": 20,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": true
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json
index d769b33ba2c2..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum member names need to be unique, but the name `A` has already been used before in enum `E`. (3:2)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json
new file mode 100644
index 000000000000..419248b77ef1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json
@@ -0,0 +1,152 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum member names need to be unique, but the name `A` has already been used before in enum `E`. (3:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 11,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumDefaultedMember",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ }
+ },
+ {
+ "type": "EnumDefaultedMember",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json
index f17ece27cf57..9d3b4fdaaa37 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json
@@ -1,11 +1,4 @@
{
- "plugins": [
- [
- "flow",
- {
- "enums": true
- }
- ]
- ],
+ "plugins": [["flow", { "enums": true }]],
"sourceType": "module"
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json
index 3dbe8477d0ab..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json
new file mode 100644
index 000000000000..b9a7090addd4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 11,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "explicitType": false,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json
index 3dbe8477d0ab..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json
new file mode 100644
index 000000000000..a6954ed31095
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 11,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "explicitType": false,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json
index 7684531c52f1..30df8c2ef701 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json
@@ -1,4 +1,4 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum type `xxx` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `E`. (1:10)"
-}
+ "plugins": [["flow", { "enums": true }]]
+
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json
new file mode 100644
index 000000000000..7b6a1da0ed1f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum type `xxx` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `E`. (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 16,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "explicitType": false,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json
index 1587909dd62e..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json
new file mode 100644
index 000000000000..a8f898034c39
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 21,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "explicitType": true,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json
index e9b2692f126a..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Symbol enum members cannot be initialized. Use `A,` in enum `E`. (2:6)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json
new file mode 100644
index 000000000000..4cf1122979e8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json
@@ -0,0 +1,86 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Symbol enum members cannot be initialized. Use `A,` in enum `E`. (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumSymbolBody",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json
index 14ed173defa0..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json
new file mode 100644
index 000000000000..c737d1129440
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumBooleanBody",
+ "start": 22,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "explicitType": true,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json
index 1587909dd62e..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json
new file mode 100644
index 000000000000..653573513644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "explicitType": true,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json
index 282f44e03ab4..db9720997638 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json
@@ -1,4 +1,4 @@
{
"plugins": [["flow", { "enums": true }]],
"throws": "The enum member initializer for `A` needs to be a literal (either a boolean, number, or string) in enum `E`. (2:6)"
-}
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json
index 14ed173defa0..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json
new file mode 100644
index 000000000000..2f1b07d00c15
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumBooleanBody",
+ "start": 22,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "explicitType": true,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json
index 7a8a81f75442..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum `E` has type `number`, so the initializer of `A` needs to be a number literal. (2:6)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json
new file mode 100644
index 000000000000..263ac8c203cb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum `E` has type `number`, so the initializer of `A` needs to be a number literal. (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumNumberBody",
+ "start": 21,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "explicitType": true,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json
index 3a3974fd4b9d..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `foo`, consider using `Foo`, in enum `E`. (2:2)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json
new file mode 100644
index 000000000000..f4f24a70b045
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json
@@ -0,0 +1,153 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `foo`, consider using `Foo`, in enum `E`. (2:2)",
+ "SyntaxError: Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `bar`, consider using `Bar`, in enum `E`. (3:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 11,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumDefaultedMember",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ },
+ {
+ "type": "EnumDefaultedMember",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json
index b668cbc42536..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json
new file mode 100644
index 000000000000..8408025e1256
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumNumberBody",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "explicitType": true,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json
index b668cbc42536..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json
new file mode 100644
index 000000000000..67dae3487d84
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json
@@ -0,0 +1,140 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumNumberBody",
+ "start": 11,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "explicitType": false,
+ "members": [
+ {
+ "type": "EnumNumberMember",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json
index 50d57cc99e4d..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "Unexpected keyword 'class' (1:5)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json
new file mode 100644
index 000000000000..f80ecb8f4d3d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'class' (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "class"
+ },
+ "name": "class"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 13,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "explicitType": false,
+ "members": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json
index 71e396752a2e..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json
new file mode 100644
index 000000000000..f3a0304fb310
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json
@@ -0,0 +1,152 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 21,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "explicitType": true,
+ "members": [
+ {
+ "type": "EnumDefaultedMember",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ }
+ },
+ {
+ "type": "EnumDefaultedMember",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json
index 71e396752a2e..53fd48c051cb 100644
--- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json
@@ -1,4 +1,3 @@
{
- "plugins": [["flow", { "enums": true }]],
- "throws": "String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)"
+ "plugins": [["flow", { "enums": true }]]
}
diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json
new file mode 100644
index 000000000000..9a637136e9c2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json
@@ -0,0 +1,192 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "EnumDeclaration",
+ "start": 0,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "E"
+ },
+ "name": "E"
+ },
+ "body": {
+ "type": "EnumStringBody",
+ "start": 21,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "explicitType": true,
+ "members": [
+ {
+ "type": "EnumStringMember",
+ "start": 26,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "init": {
+ "type": "StringLiteral",
+ "start": 30,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": "b",
+ "raw": "\"b\""
+ },
+ "value": "b"
+ }
+ },
+ {
+ "type": "EnumStringMember",
+ "start": 37,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "init": {
+ "type": "StringLiteral",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": "c",
+ "raw": "\"c\""
+ },
+ "value": "c"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json
index c9188366d4e8..2104ca43283f 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json
@@ -1,5 +1,3 @@
{
- "sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Spread operator cannot appear in class or interface definitions (3:2)"
+ "sourceType": "module"
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json
new file mode 100644
index 000000000000..f896b9fffbcb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json
@@ -0,0 +1,130 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareClass",
+ "start": 8,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 24,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json
index 658f8c434773..2104ca43283f 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json
@@ -1,5 +1,3 @@
{
- "sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Spread operator cannot appear in class or interface definitions (4:2)"
+ "sourceType": "module"
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json
new file mode 100644
index 000000000000..6a0edc43c316
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json
@@ -0,0 +1,184 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareClass",
+ "start": 8,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 24,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 28,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 33,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json
index c9188366d4e8..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Spread operator cannot appear in class or interface definitions (3:2)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json
new file mode 100644
index 000000000000..7fa5b4a0b07f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json
@@ -0,0 +1,185 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)",
+ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (3:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareClass",
+ "start": 8,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 24,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 35,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 40,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json
index 658f8c434773..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Spread operator cannot appear in class or interface definitions (4:2)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json
new file mode 100644
index 000000000000..224a0566437c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json
@@ -0,0 +1,238 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)",
+ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (4:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareClass",
+ "start": 8,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "D"
+ },
+ "name": "D"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 24,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 28,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 33,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ },
+ {
+ "type": "ObjectTypeProperty",
+ "start": 50,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 50,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 55,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json
deleted file mode 100644
index 658f8c434773..000000000000
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Spread operator cannot appear in class or interface definitions (4:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json
new file mode 100644
index 000000000000..0f4fe47c8e64
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json
@@ -0,0 +1,184 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "InterfaceDeclaration",
+ "start": 8,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "F"
+ },
+ "name": "F"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 20,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 24,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 29,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json
index c9188366d4e8..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Spread operator cannot appear in class or interface definitions (3:2)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json
new file mode 100644
index 000000000000..685bd5b4d17e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json
@@ -0,0 +1,185 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)",
+ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (3:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "InterfaceDeclaration",
+ "start": 8,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "G"
+ },
+ "name": "G"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 20,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 31,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 36,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json
index 658f8c434773..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Spread operator cannot appear in class or interface definitions (4:2)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json
new file mode 100644
index 000000000000..37b85349439d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json
@@ -0,0 +1,238 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)",
+ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (4:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "InterfaceDeclaration",
+ "start": 8,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "H"
+ },
+ "name": "H"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 20,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 24,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 29,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ },
+ {
+ "type": "ObjectTypeProperty",
+ "start": 46,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 46,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 51,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json
index 49936ac94990..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Explicit inexact syntax cannot appear inside an explicit exact object type (2:29)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json
new file mode 100644
index 000000000000..98ff5ceeead4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json
@@ -0,0 +1,182 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax cannot appear inside an explicit exact object type (2:25)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 8,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 17,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 25,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": true,
+ "inexact": true
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json
index ebb74417a527..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Explicit inexact syntax must appear at the end of an inexact object (2:15)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json
new file mode 100644
index 000000000000..24b9575138dc
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json
@@ -0,0 +1,182 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 8,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 17,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 23,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 28,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": true
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/options.json
index 6d703769bf61..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json
new file mode 100644
index 000000000000..8efbd4b84fe9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json
@@ -0,0 +1,235 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 8,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 17,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 18,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ },
+ {
+ "type": "ObjectTypeProperty",
+ "start": 34,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ },
+ "identifierName": "y"
+ },
+ "name": "y"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": true
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/options.json
index 6d703769bf61..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json
new file mode 100644
index 000000000000..fe5b3ee400f9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json
@@ -0,0 +1,182 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 8,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "U"
+ },
+ "name": "U"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 17,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 18,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": true
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/options.json
index 6d703769bf61..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/options.json
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json
new file mode 100644
index 000000000000..0bedbf8f82e4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json
@@ -0,0 +1,230 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 8,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "V"
+ },
+ "name": "V"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 17,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 18,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "init",
+ "method": false,
+ "value": {
+ "type": "NumberTypeAnnotation",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ }
+ },
+ "variance": null,
+ "optional": false
+ },
+ {
+ "type": "ObjectTypeSpreadProperty",
+ "start": 34,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "argument": {
+ "type": "GenericTypeAnnotation",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ }
+ }
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": true
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/options.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/options.json
deleted file mode 100644
index b945b9a0a123..000000000000
--- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json
new file mode 100644
index 000000000000..b4b12c31dccb
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json
@@ -0,0 +1,94 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "InterfaceDeclaration",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/options.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/options.json
deleted file mode 100644
index 7aecee1ff0ae..000000000000
--- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json
new file mode 100644
index 000000000000..1765354398c7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "implements": [
+ {
+ "type": "ClassImplements",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ },
+ "typeParameters": null
+ }
+ ],
+ "body": {
+ "type": "ClassBody",
+ "start": 28,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/03/options.json b/packages/babel-parser/test/fixtures/flow/iterator/03/options.json
deleted file mode 100644
index 7bad2fe143ae..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/03/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@asyncIterator (1:19)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/03/output.json b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json
new file mode 100644
index 000000000000..cac241733955
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json
@@ -0,0 +1,89 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@asyncIterator (1:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "@@asyncIterator"
+ },
+ "name": "@@asyncIterator"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/04/options.json b/packages/babel-parser/test/fixtures/flow/iterator/04/options.json
deleted file mode 100644
index ae3871cf99a0..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/04/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@iterator (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/04/output.json b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json
new file mode 100644
index 000000000000..e86fe7ccc7a0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json
@@ -0,0 +1,89 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@iterator (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "@@iterator"
+ },
+ "name": "@@iterator"
+ },
+ "init": null
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/05/options.json b/packages/babel-parser/test/fixtures/flow/iterator/05/options.json
deleted file mode 100644
index 9d235ec74a06..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/05/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@asyncIterator (2:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/05/output.json b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json
new file mode 100644
index 000000000000..a5e29cf34dc2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@asyncIterator (2:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "@@asyncIterator"
+ },
+ "name": "@@asyncIterator"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/06/options.json b/packages/babel-parser/test/fixtures/flow/iterator/06/options.json
deleted file mode 100644
index 515a2cba19f8..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/06/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@iterator (2:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/06/output.json b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json
new file mode 100644
index 000000000000..08e5603a221c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json
@@ -0,0 +1,144 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@iterator (2:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "@@iterator"
+ },
+ "name": "@@iterator"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/07/options.json b/packages/babel-parser/test/fixtures/flow/iterator/07/options.json
deleted file mode 100644
index 4c1f323d1622..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/07/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@iterator (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/07/output.json b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json
new file mode 100644
index 000000000000..60d612821347
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json
@@ -0,0 +1,86 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@iterator (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "@@iterator"
+ },
+ "name": "@@iterator"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "NumberTypeAnnotation",
+ "start": 18,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/08/options.json b/packages/babel-parser/test/fixtures/flow/iterator/08/options.json
deleted file mode 100644
index 3efa2ffcd0a1..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/08/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@asyncIterator (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/08/output.json b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json
new file mode 100644
index 000000000000..3994f46fa03e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json
@@ -0,0 +1,86 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@asyncIterator (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "@@asyncIterator"
+ },
+ "name": "@@asyncIterator"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "NumberTypeAnnotation",
+ "start": 23,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/09/options.json b/packages/babel-parser/test/fixtures/flow/iterator/09/options.json
deleted file mode 100644
index 515a2cba19f8..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/09/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@iterator (2:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/09/output.json b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json
new file mode 100644
index 000000000000..95c09f5b7c60
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@iterator (2:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 8,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 12,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "@@iterator"
+ },
+ "name": "@@iterator"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/10/options.json b/packages/babel-parser/test/fixtures/flow/iterator/10/options.json
deleted file mode 100644
index 9d235ec74a06..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/10/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@asyncIterator (2:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/10/output.json b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json
new file mode 100644
index 000000000000..9e58c564ebbf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@asyncIterator (2:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 8,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 12,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "@@asyncIterator"
+ },
+ "name": "@@asyncIterator"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 30,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/11/options.json b/packages/babel-parser/test/fixtures/flow/iterator/11/options.json
deleted file mode 100644
index 248b8a4d9d0a..000000000000
--- a/packages/babel-parser/test/fixtures/flow/iterator/11/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid identifier @@random (2:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/iterator/11/output.json b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json
new file mode 100644
index 000000000000..b43086a4226b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json
@@ -0,0 +1,161 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Invalid identifier @@random (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "start": 8,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "properties": [
+ {
+ "type": "ObjectMethod",
+ "start": 12,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "method": true,
+ "key": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "@@random"
+ },
+ "name": "@@random"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json
index 06ad6ded6032..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json
+++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json
@@ -3,6 +3,5 @@
"plugins": [
"jsx",
"flow"
- ],
- "throws": "Identifier 'C1' has already been declared (2:6)"
+ ]
}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json
new file mode 100644
index 000000000000..c350f1ed1904
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json
@@ -0,0 +1,143 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'C1' has already been declared (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareClass",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "C1"
+ },
+ "name": "C1"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ },
+ {
+ "type": "ClassDeclaration",
+ "start": 20,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "identifierName": "C1"
+ },
+ "name": "C1"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json
index 5672ce1b6444..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json
@@ -3,6 +3,5 @@
"plugins": [
"jsx",
"flow"
- ],
- "throws": "Identifier 'I' has already been declared (2:10)"
+ ]
}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json
new file mode 100644
index 000000000000..823ca9be9eac
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json
@@ -0,0 +1,180 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'I' has already been declared (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "InterfaceDeclaration",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "I"
+ },
+ "name": "I"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "InterfaceDeclaration",
+ "start": 16,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "I"
+ },
+ "name": "I"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 28,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json
index 946261f4e872..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json
+++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json
@@ -3,6 +3,5 @@
"plugins": [
"jsx",
"flow"
- ],
- "throws": "Identifier 'T1' has already been declared (2:5)"
+ ]
}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json
new file mode 100644
index 000000000000..080077918fd1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'T1' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "T1"
+ },
+ "name": "T1"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "StringTypeAnnotation",
+ "start": 10,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ },
+ {
+ "type": "TypeAlias",
+ "start": 18,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "T1"
+ },
+ "name": "T1"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "NumberTypeAnnotation",
+ "start": 28,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json
deleted file mode 100644
index 65bc24a66fcd..000000000000
--- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "getter must not have any formal parameters (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json
new file mode 100644
index 000000000000..efdc8832124e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json
@@ -0,0 +1,212 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: getter must not have any formal parameters (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 13,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "get",
+ "method": true,
+ "value": {
+ "type": "FunctionTypeAnnotation",
+ "start": 13,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "params": [],
+ "rest": {
+ "type": "FunctionTypeParam",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "name": null,
+ "optional": false,
+ "typeAnnotation": {
+ "type": "GenericTypeAnnotation",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ }
+ }
+ },
+ "typeParameters": null,
+ "returnType": {
+ "type": "NumberTypeAnnotation",
+ "start": 28,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ }
+ },
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/options.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/options.json
deleted file mode 100644
index 65bc24a66fcd..000000000000
--- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "getter must not have any formal parameters (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json
new file mode 100644
index 000000000000..66bd6ed1baf2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json
@@ -0,0 +1,212 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: getter must not have any formal parameters (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 13,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "get",
+ "method": true,
+ "value": {
+ "type": "FunctionTypeAnnotation",
+ "start": 13,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "params": [
+ {
+ "type": "FunctionTypeParam",
+ "start": 19,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "optional": false,
+ "typeAnnotation": {
+ "type": "NumberTypeAnnotation",
+ "start": 23,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ }
+ }
+ }
+ ],
+ "rest": null,
+ "typeParameters": null,
+ "returnType": {
+ "type": "NumberTypeAnnotation",
+ "start": 32,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ }
+ }
+ },
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/options.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/options.json
deleted file mode 100644
index 6a1567782202..000000000000
--- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "setter must have exactly one formal parameter (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json
new file mode 100644
index 000000000000..b79f9a52c897
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: setter must have exactly one formal parameter (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 13,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "set",
+ "method": true,
+ "value": {
+ "type": "FunctionTypeAnnotation",
+ "start": 13,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "params": [],
+ "rest": null,
+ "typeParameters": null,
+ "returnType": {
+ "type": "VoidTypeAnnotation",
+ "start": 22,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ },
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/options.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/options.json
deleted file mode 100644
index 15ce6a4c5a51..000000000000
--- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "setter function argument must not be a rest parameter (2:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json
new file mode 100644
index 000000000000..5171dbc8a45f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json
@@ -0,0 +1,212 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: setter function argument must not be a rest parameter (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeProperty",
+ "start": 13,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "key": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "static": false,
+ "proto": false,
+ "kind": "set",
+ "method": true,
+ "value": {
+ "type": "FunctionTypeAnnotation",
+ "start": 13,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "params": [],
+ "rest": {
+ "type": "FunctionTypeParam",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "name": null,
+ "optional": false,
+ "typeAnnotation": {
+ "type": "GenericTypeAnnotation",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "w"
+ },
+ "name": "w"
+ }
+ }
+ },
+ "typeParameters": null,
+ "returnType": {
+ "type": "VoidTypeAnnotation",
+ "start": 26,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ }
+ }
+ },
+ "optional": false
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/options.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/options.json
deleted file mode 100644
index 0c2cdd4d777c..000000000000
--- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json
new file mode 100644
index 000000000000..bc568d5767be
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "OpaqueType",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "NumberTypeAnnotation",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/optional-type/6/options.json b/packages/babel-parser/test/fixtures/flow/optional-type/6/options.json
deleted file mode 100644
index fb2831d6188b..000000000000
--- a/packages/babel-parser/test/fixtures/flow/optional-type/6/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "A binding pattern parameter cannot be optional in an implementation signature. (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json b/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json
new file mode 100644
index 000000000000..3ef0fdc07d93
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json
@@ -0,0 +1,124 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: A binding pattern parameter cannot be optional in an implementation signature. (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "elements": [],
+ "optional": true
+ },
+ {
+ "type": "ObjectPattern",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "properties": []
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/predicates/4/options.json b/packages/babel-parser/test/fixtures/flow/predicates/4/options.json
deleted file mode 100644
index cec83fa54fba..000000000000
--- a/packages/babel-parser/test/fixtures/flow/predicates/4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (1:18)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/predicates/4/output.json b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json
new file mode 100644
index 000000000000..e1e9eeffbc7b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json
@@ -0,0 +1,241 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "errors": [
+ "SyntaxError: Spaces between ´%´ and ´checks´ are not allowed here. (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 54
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "init": {
+ "type": "ArrowFunctionExpression",
+ "start": 8,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "predicate": {
+ "type": "InferredPredicate",
+ "start": 20,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "returnType": null,
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 9,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "x"
+ },
+ "name": "x",
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 10,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "typeAnnotation": {
+ "type": "MixedTypeAnnotation",
+ "start": 12,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BinaryExpression",
+ "start": 32,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 32,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ }
+ },
+ "operator": "typeof",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 39
+ },
+ "end": {
+ "line": 1,
+ "column": 40
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ },
+ "operator": "===",
+ "right": {
+ "type": "StringLiteral",
+ "start": 45,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 1,
+ "column": 53
+ }
+ },
+ "extra": {
+ "rawValue": "string",
+ "raw": "\"string\""
+ },
+ "value": "string"
+ }
+ }
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/predicates/5/options.json b/packages/babel-parser/test/fixtures/flow/predicates/5/options.json
deleted file mode 100644
index dbdc7697ac5b..000000000000
--- a/packages/babel-parser/test/fixtures/flow/predicates/5/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Spaces between ´%´ and ´checks´ are not allowed here. (1:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/predicates/5/output.json b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json
new file mode 100644
index 000000000000..0d7a47afacfd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json
@@ -0,0 +1,210 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Spaces between ´%´ and ´checks´ are not allowed here. (1:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ ],
+ "predicate": {
+ "type": "InferredPredicate",
+ "start": 17,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "returnType": null,
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 30,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "argument": {
+ "type": "BinaryExpression",
+ "start": 37,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "left": {
+ "type": "UnaryExpression",
+ "start": 37,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "operator": "typeof",
+ "prefix": true,
+ "argument": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ },
+ "operator": "===",
+ "right": {
+ "type": "StringLiteral",
+ "start": 50,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "extra": {
+ "rawValue": "string",
+ "raw": "\"string\""
+ },
+ "value": "string"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-ambiguous/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-ambiguous/options.json
index 49dc6c3d5a6a..abfcf6f44eba 100644
--- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-ambiguous/options.json
+++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-ambiguous/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate. (4:4)"
+ "throws": "Unexpected token, expected \":\" (4:27)"
}
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/options.json
deleted file mode 100644
index 215199590424..000000000000
--- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (2:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json
new file mode 100644
index 000000000000..598107b6493b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json
@@ -0,0 +1,233 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 43,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "ConditionalExpression",
+ "start": 43,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "test": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "consequent": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "b"
+ },
+ "name": "b",
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 47
+ }
+ },
+ "alternate": {
+ "type": "ArrowFunctionExpression",
+ "start": 53,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrowFunctionExpression",
+ "start": 54,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 54,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 59,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "d"
+ },
+ "name": "d"
+ }
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ },
+ "identifierName": "e"
+ },
+ "name": "e"
+ }
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": " Function which looks like a return type",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": " Function which looks like a return type",
+ "start": 0,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/options.json
deleted file mode 100644
index 36a678e0e538..000000000000
--- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (2:8)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json
new file mode 100644
index 000000000000..c65e342557c3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json
@@ -0,0 +1,353 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 47,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "ConditionalExpression",
+ "start": 47,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "test": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "consequent": {
+ "type": "ArrowFunctionExpression",
+ "start": 51,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "predicate": null,
+ "returnType": {
+ "type": "TypeAnnotation",
+ "start": 63,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "typeAnnotation": {
+ "type": "GenericTypeAnnotation",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "d"
+ },
+ "name": "d"
+ }
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrowFunctionExpression",
+ "start": 55,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 55,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 60,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ }
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "identifierName": "e"
+ },
+ "name": "e",
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 70
+ }
+ },
+ "typeParameters": {
+ "type": "TypeParameterDeclaration",
+ "start": 51,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "params": [
+ {
+ "type": "TypeParameter",
+ "start": 52,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "name": "T",
+ "variance": null
+ }
+ ]
+ }
+ },
+ "alternate": {
+ "type": "ArrowFunctionExpression",
+ "start": 76,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 76,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ }
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": " Invalid LHS parameter after type parameters",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": " Invalid LHS parameter after type parameters",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/options.json
deleted file mode 100644
index 2fc0696df35a..000000000000
--- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json
new file mode 100644
index 000000000000..ae2fe29bafc4
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json
@@ -0,0 +1,270 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in function parameter list (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 47,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "ConditionalExpression",
+ "start": 47,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "test": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "consequent": {
+ "type": "ArrowFunctionExpression",
+ "start": 51,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrowFunctionExpression",
+ "start": 52,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 52,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ }
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 64,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "identifierName": "e"
+ },
+ "name": "e",
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 63
+ }
+ }
+ },
+ "alternate": {
+ "type": "ArrowFunctionExpression",
+ "start": 69,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 69,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 74,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ }
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": " Invalid LHS parameter after type parameters",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": " Invalid LHS parameter after type parameters",
+ "start": 0,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 46
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/options.json
deleted file mode 100644
index 215199590424..000000000000
--- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Invalid left-hand side in arrow function parameters (2:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json
new file mode 100644
index 000000000000..2479192b7877
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json
@@ -0,0 +1,270 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "errors": [
+ "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 25,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "expression": {
+ "type": "ConditionalExpression",
+ "start": 25,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "test": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "consequent": {
+ "type": "ArrowFunctionExpression",
+ "start": 29,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "ArrowFunctionExpression",
+ "start": 36,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 36,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "c"
+ },
+ "name": "c"
+ }
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "identifierName": "d"
+ },
+ "name": "d",
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 47
+ }
+ }
+ },
+ "alternate": {
+ "type": "ArrowFunctionExpression",
+ "start": 53,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 53,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ },
+ "identifierName": "g"
+ },
+ "name": "g"
+ }
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": " Invalid LHS parameter",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": " Invalid LHS parameter",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json
index 4a1b4e5c5cd4..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:14)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json
new file mode 100644
index 000000000000..a5fb057eb10c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "DeclareClass",
+ "start": 13,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json
index 187fea591b95..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:18)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json
new file mode 100644
index 000000000000..93ec46f9bc31
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "DeclareInterface",
+ "start": 13,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json
index 04242bd1565b..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:10)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json
new file mode 100644
index 000000000000..9de1cc4338cf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "InterfaceDeclaration",
+ "start": 13,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/options.json
deleted file mode 100644
index 81dc2c90799f..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json
new file mode 100644
index 000000000000..7b807528c3b9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "OpaqueType",
+ "start": 13,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json
new file mode 100644
index 000000000000..a69cbb049a89
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 6,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "TypeAlias",
+ "start": 13,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json
index 187fea591b95..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:18)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json
new file mode 100644
index 000000000000..a5e92908c53a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json
@@ -0,0 +1,150 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareClass",
+ "start": 0,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ },
+ {
+ "type": "DeclareInterface",
+ "start": 19,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 39,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json
index 4a1b4e5c5cd4..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:14)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json
new file mode 100644
index 000000000000..b2a4c51e2bc0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json
@@ -0,0 +1,150 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareInterface",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ },
+ {
+ "type": "DeclareClass",
+ "start": 23,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 39,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json
index b6ff3a4b0987..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:4)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json
new file mode 100644
index 000000000000..8389c568e814
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json
@@ -0,0 +1,151 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareVariable",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "A"
+ },
+ "name": "A",
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 13,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "typeAnnotation": {
+ "type": "NumberTypeAnnotation",
+ "start": 15,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 23,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json
index 04242bd1565b..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:10)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json
new file mode 100644
index 000000000000..d79d846383cf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json
@@ -0,0 +1,150 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "InterfaceDeclaration",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ },
+ {
+ "type": "InterfaceDeclaration",
+ "start": 15,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json
index 4a1b4e5c5cd4..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:14)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json
new file mode 100644
index 000000000000..2dbdc1e727c2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "DeclareClass",
+ "start": 11,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json
index 187fea591b95..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:18)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json
new file mode 100644
index 000000000000..a13ba7dc082c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "DeclareInterface",
+ "start": 11,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 31,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json
index 04242bd1565b..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:10)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json
new file mode 100644
index 000000000000..a8dc40e08d4c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "InterfaceDeclaration",
+ "start": 11,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/options.json
deleted file mode 100644
index 81dc2c90799f..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json
new file mode 100644
index 000000000000..07a5a53fbc08
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "OpaqueType",
+ "start": 11,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json
new file mode 100644
index 000000000000..6833e37c4de1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "TypeAlias",
+ "start": 11,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/options.json
deleted file mode 100644
index 336686170eb0..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json
new file mode 100644
index 000000000000..b374e2bcebd9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "OpaqueType",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/options.json
deleted file mode 100644
index b6ff3a4b0987..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json
new file mode 100644
index 000000000000..9f326dfe3e5e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "OpaqueType",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 20,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 24,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/options.json
deleted file mode 100644
index 81dc2c90799f..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json
new file mode 100644
index 000000000000..86b98af15006
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json
@@ -0,0 +1,148 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "OpaqueType",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "OpaqueType",
+ "start": 20,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 36,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json
new file mode 100644
index 000000000000..76300249f569
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json
@@ -0,0 +1,147 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "OpaqueType",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "TypeAlias",
+ "start": 20,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/options.json
deleted file mode 100644
index b6ff3a4b0987..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json
new file mode 100644
index 000000000000..b5b462a59cf5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "OpaqueType",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 20,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 24,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/options.json
deleted file mode 100644
index 336686170eb0..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json
new file mode 100644
index 000000000000..916e60eaa94a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 13,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 19,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json
index 04242bd1565b..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:10)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json
new file mode 100644
index 000000000000..0aa57e51c3ff
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json
@@ -0,0 +1,142 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "NumberTypeAnnotation",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ }
+ },
+ {
+ "type": "InterfaceDeclaration",
+ "start": 17,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/options.json
deleted file mode 100644
index b6ff3a4b0987..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json
new file mode 100644
index 000000000000..6e394ffbcda1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 13,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/options.json
deleted file mode 100644
index 81dc2c90799f..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json
new file mode 100644
index 000000000000..95d0b22f7cfd
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json
@@ -0,0 +1,147 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "OpaqueType",
+ "start": 13,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json
new file mode 100644
index 000000000000..09c73482f8f1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json
@@ -0,0 +1,146 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "TypeAlias",
+ "start": 13,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/options.json
deleted file mode 100644
index b6ff3a4b0987..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json
new file mode 100644
index 000000000000..52626b852e33
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 13,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 17,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json
index 187fea591b95..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:18)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json
new file mode 100644
index 000000000000..f60940e178bf
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:18)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "DeclareInterface",
+ "start": 11,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 29,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 31,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json
index 04242bd1565b..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Identifier 'A' has already been declared (2:10)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json
new file mode 100644
index 000000000000..271c66e47dd7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json
@@ -0,0 +1,164 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "InterfaceDeclaration",
+ "start": 11,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 23,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/options.json
deleted file mode 100644
index 81dc2c90799f..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json
new file mode 100644
index 000000000000..d41f91a9d947
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json
@@ -0,0 +1,163 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "OpaqueType",
+ "start": 11,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "supertype": null,
+ "impltype": {
+ "type": "ObjectTypeAnnotation",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json
new file mode 100644
index 000000000000..4f1dcc135976
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json
@@ -0,0 +1,162 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "extra": {
+ "rawValue": 1,
+ "raw": "1"
+ },
+ "value": 1
+ }
+ }
+ ],
+ "kind": "var"
+ },
+ {
+ "type": "TypeAlias",
+ "start": 11,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/131/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/131/options.json
deleted file mode 100644
index 50bea8a5db27..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-annotations/131/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type number (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json
new file mode 100644
index 000000000000..ef2bc17e2d96
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json
@@ -0,0 +1,86 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type number (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "number"
+ },
+ "name": "number"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "StringTypeAnnotation",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/132/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/132/options.json
deleted file mode 100644
index 257d651b33e2..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-annotations/132/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type number (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json
new file mode 100644
index 000000000000..aa2b8b19ecb0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type number (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "typeParameters": {
+ "type": "TypeParameterDeclaration",
+ "start": 8,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "params": [
+ {
+ "type": "TypeParameter",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "name": "number",
+ "variance": null
+ }
+ ]
+ },
+ "right": {
+ "type": "StringTypeAnnotation",
+ "start": 19,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/133/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/133/options.json
deleted file mode 100644
index 2c7a5836d8bc..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-annotations/133/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json
new file mode 100644
index 000000000000..bb722c84feec
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json
@@ -0,0 +1,236 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "generator": false,
+ "async": false,
+ "typeParameters": {
+ "type": "TypeParameterDeclaration",
+ "start": 10,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "params": [
+ {
+ "type": "TypeParameter",
+ "start": 11,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "name": "string",
+ "variance": null
+ }
+ ]
+ },
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ },
+ "identifierName": "x"
+ },
+ "name": "x",
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 20,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 22,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ }
+ }
+ }
+ ],
+ "predicate": null,
+ "returnType": {
+ "type": "TypeAnnotation",
+ "start": 29,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 31,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "start": 38,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 42,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "argument": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ }
+ }
+ ],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/134/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/134/options.json
deleted file mode 100644
index 396a14ca22d4..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-annotations/134/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type bool (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json
new file mode 100644
index 000000000000..c88abb4a585c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json
@@ -0,0 +1,86 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type bool (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareTypeAlias",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "bool"
+ },
+ "name": "bool"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "AnyTypeAnnotation",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/137/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/137/options.json
deleted file mode 100644
index 786acad32af0..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-annotations/137/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Spread operator cannot appear in class or interface definitions (2:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json
new file mode 100644
index 000000000000..2e33b31f6c8f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json
@@ -0,0 +1,140 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Spread operator cannot appear in class or interface definitions (2:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "InterfaceDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 12,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeSpreadProperty",
+ "start": 15,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 1
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "argument": {
+ "type": "AnyTypeAnnotation",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ }
+ }
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ },
+ {
+ "type": "EmptyStatement",
+ "start": 24,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 1
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/139/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/139/options.json
deleted file mode 100644
index 2b0782bcbc3e..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-annotations/139/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Spread properties cannot have variance (3:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json
new file mode 100644
index 000000000000..6d1756ac6212
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json
@@ -0,0 +1,190 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "errors": [
+ "SyntaxError: Spread properties cannot have variance (3:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "TypeAlias",
+ "start": 11,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "ObjectTypeAnnotation",
+ "start": 20,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "callProperties": [],
+ "properties": [
+ {
+ "type": "ObjectTypeSpreadProperty",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 1
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "argument": {
+ "type": "GenericTypeAnnotation",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 5
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 5
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ }
+ }
+ }
+ ],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false,
+ "inexact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/options.json
deleted file mode 100644
index 24792311b3e9..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25` (1:20)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json
new file mode 100644
index 000000000000..a08797bcf335
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json
@@ -0,0 +1,173 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25` (1:20)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 11,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "left": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "right": {
+ "type": "StringLiteral",
+ "start": 17,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "extra": {
+ "rawValue": "1",
+ "raw": "\"1\""
+ },
+ "value": "1"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 20,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 22,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 30,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/options.json
deleted file mode 100644
index 7624c4d3b99a..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json
new file mode 100644
index 000000000000..5ac98d7b46b7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ },
+ "importKind": null,
+ "local": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ }
+ }
+ ],
+ "importKind": "type",
+ "source": {
+ "type": "StringLiteral",
+ "start": 28,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/options.json
deleted file mode 100644
index 7624c4d3b99a..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json
new file mode 100644
index 000000000000..3a1010d807fe
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ }
+ }
+ ],
+ "importKind": "typeof",
+ "source": {
+ "type": "StringLiteral",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/options.json
deleted file mode 100644
index d64a5d353bf8..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:19)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json
new file mode 100644
index 000000000000..dcbca6978a12
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportNamespaceSpecifier",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ }
+ }
+ ],
+ "importKind": "typeof",
+ "source": {
+ "type": "StringLiteral",
+ "start": 31,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/options.json
index 5133797973d2..3962be507d38 100644
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/options.json
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/options.json
@@ -1,3 +1,7 @@
{
- "throws": "Unexpected keyword 'debugger' (1:17)"
-}
+ "sourceType": "module",
+ "plugins": [
+ "jsx",
+ "flow"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json
new file mode 100644
index 000000000000..05cc09533a23
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'debugger' (1:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 39
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 9,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "type"
+ },
+ "name": "type"
+ },
+ "importKind": null,
+ "local": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "debugger"
+ },
+ "name": "debugger"
+ }
+ }
+ ],
+ "importKind": "value",
+ "source": {
+ "type": "StringLiteral",
+ "start": 33,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json
deleted file mode 100644
index 036229c5b95a..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json
new file mode 100644
index 000000000000..90585f1b4f80
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 13,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ "importKind": "type",
+ "local": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ }
+ ],
+ "importKind": "type",
+ "source": {
+ "type": "StringLiteral",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/options.json
deleted file mode 100644
index e425b795f180..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json
new file mode 100644
index 000000000000..4969f577a320
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 9,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ },
+ "importKind": "typeof",
+ "local": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ }
+ }
+ ],
+ "importKind": "value",
+ "source": {
+ "type": "StringLiteral",
+ "start": 30,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/options.json
deleted file mode 100644
index 7624c4d3b99a..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json
new file mode 100644
index 000000000000..2b57e99a30e7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 9,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ },
+ "importKind": "type",
+ "local": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ }
+ }
+ ],
+ "importKind": "value",
+ "source": {
+ "type": "StringLiteral",
+ "start": 28,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json
deleted file mode 100644
index 7aa4274c7160..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements (1:15)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json
new file mode 100644
index 000000000000..174e856304f7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json
@@ -0,0 +1,126 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "errors": [
+ "SyntaxError: The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements (1:15)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 15,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "imported": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ },
+ "importKind": "typeof",
+ "local": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ },
+ "identifierName": "t"
+ },
+ "name": "t"
+ }
+ }
+ ],
+ "importKind": "typeof",
+ "source": {
+ "type": "StringLiteral",
+ "start": 30,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/options.json
deleted file mode 100644
index 0c2cdd4d777c..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Cannot overwrite reserved type string (1:12)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json
new file mode 100644
index 000000000000..95872d960a5c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json
@@ -0,0 +1,108 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type string (1:12)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "start": 12,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ },
+ "identifierName": "string"
+ },
+ "name": "string"
+ }
+ }
+ ],
+ "importKind": "type",
+ "source": {
+ "type": "StringLiteral",
+ "start": 24,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "extra": {
+ "rawValue": "foo",
+ "raw": "\"foo\""
+ },
+ "value": "foo"
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/options.json
deleted file mode 100644
index 022607b81797..000000000000
--- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Type parameter declaration needs a default, since a preceding type parameter declaration has a default. (1:28)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json
new file mode 100644
index 000000000000..b902d88e157e
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json
@@ -0,0 +1,169 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "errors": [
+ "SyntaxError: Type parameter declaration needs a default, since a preceding type parameter declaration has a default. (1:28)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 43
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeParameters": {
+ "type": "TypeParameterDeclaration",
+ "start": 6,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "params": [
+ {
+ "type": "TypeParameter",
+ "start": 7,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "name": "HasDefault",
+ "variance": null,
+ "default": {
+ "type": "StringTypeAnnotation",
+ "start": 20,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ },
+ {
+ "type": "TypeParameter",
+ "start": 28,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "name": "NoDefault",
+ "variance": null
+ }
+ ]
+ },
+ "right": {
+ "type": "GenericTypeAnnotation",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/options.json
index f45196d78df9..a282a109bf16 100644
--- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/options.json
+++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/options.json
@@ -1,4 +1,7 @@
{
- "throws": "Unexpected keyword 'delete' (1:14)",
- "plugins": ["flow", "jsx"]
-}
+ "sourceType": "module",
+ "plugins": [
+ "flow",
+ "jsx"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json
new file mode 100644
index 000000000000..a86c5b5aebde
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json
@@ -0,0 +1,94 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected keyword 'delete' (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "DeclareClass",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ },
+ "identifierName": "delete"
+ },
+ "name": "delete"
+ },
+ "typeParameters": null,
+ "extends": [],
+ "implements": [],
+ "mixins": [],
+ "body": {
+ "type": "ObjectTypeAnnotation",
+ "start": 21,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "callProperties": [],
+ "properties": [],
+ "indexers": [],
+ "internalSlots": [],
+ "exact": false
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/options.json
deleted file mode 100644
index 101e77f3861c..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "`_` is only allowed as a type argument to call or new (2:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json
new file mode 100644
index 000000000000..297c8d177689
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json
@@ -0,0 +1,241 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: `_` is only allowed as a type argument to call or new (2:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 8,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 12,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "identifierName": "x"
+ },
+ "name": "x",
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 13,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "typeAnnotation": {
+ "type": "GenericTypeAnnotation",
+ "start": 15,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "typeParameters": {
+ "type": "TypeParameterInstantiation",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "params": [
+ {
+ "type": "GenericTypeAnnotation",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "identifierName": "_"
+ },
+ "name": "_"
+ }
+ }
+ ]
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "Generic"
+ },
+ "name": "Generic"
+ }
+ }
+ }
+ },
+ "init": {
+ "type": "NumericLiteral",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "extra": {
+ "rawValue": 3,
+ "raw": "3"
+ },
+ "value": 3
+ }
+ }
+ ],
+ "kind": "var",
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json
index 85a0456eceff..d822c40fbba2 100644
--- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json
+++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json
@@ -1,5 +1,4 @@
{
"sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Cannot overwrite reserved type _ (2:5)"
+ "plugins": ["jsx", "flow"]
}
diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json
new file mode 100644
index 000000000000..53ac01f6fe9a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type _ (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 8,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "_"
+ },
+ "name": "_"
+ },
+ "typeParameters": null,
+ "right": {
+ "type": "NumberTypeAnnotation",
+ "start": 17,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/options.json
deleted file mode 100644
index 872ad2f73408..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["jsx", "flow"],
- "throws": "Cannot overwrite reserved type _ (2:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json
new file mode 100644
index 000000000000..e89da7ec21b6
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json
@@ -0,0 +1,174 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Cannot overwrite reserved type _ (2:13)",
+ "SyntaxError: `_` is only allowed as a type argument to call or new (2:19)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TypeAlias",
+ "start": 8,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 13,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "Generic"
+ },
+ "name": "Generic"
+ },
+ "typeParameters": {
+ "type": "TypeParameterDeclaration",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "params": [
+ {
+ "type": "TypeParameter",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "name": "_",
+ "variance": null
+ }
+ ]
+ },
+ "right": {
+ "type": "GenericTypeAnnotation",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "identifierName": "_"
+ },
+ "name": "_"
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": "@flow",
+ "start": 0,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/options.json
deleted file mode 100644
index e4012a53ad5d..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The type cast expression is expected to be wrapped with parenthesis (1:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json
new file mode 100644
index 000000000000..098b44cec651
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json
@@ -0,0 +1,149 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "funccall"
+ },
+ "name": "funccall"
+ },
+ "arguments": [
+ {
+ "type": "TypeCastExpression",
+ "start": 9,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 10,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 12,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/options.json
deleted file mode 100644
index 3f861de320eb..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The type cast expression is expected to be wrapped with parenthesis (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json
new file mode 100644
index 000000000000..6b5b957074e0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "errors": [
+ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "funccall"
+ },
+ "name": "funccall"
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "TypeCastExpression",
+ "start": 12,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 13,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 15,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/options.json
deleted file mode 100644
index 847e987ef0af..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The type cast expression is expected to be wrapped with parenthesis (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json
new file mode 100644
index 000000000000..0e18e29a41ea
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json
@@ -0,0 +1,171 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 1,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expressions": [
+ {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ {
+ "type": "TypeCastExpression",
+ "start": 4,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "B"
+ },
+ "name": "B"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "typeAnnotation": {
+ "type": "GenericTypeAnnotation",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "typeParameters": null,
+ "id": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ }
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json
deleted file mode 100644
index 18cdf0d35e40..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The type cast expression is expected to be wrapped with parenthesis (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json
new file mode 100644
index 000000000000..8170ccf4c8d9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "errors": [
+ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "elements": [
+ {
+ "type": "TypeCastExpression",
+ "start": 1,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 2,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 4,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json
deleted file mode 100644
index 624681c0d415..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The type cast expression is expected to be wrapped with parenthesis (1:3)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json
new file mode 100644
index 000000000000..c5ba396b8101
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json
@@ -0,0 +1,136 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:3)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 1,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "elements": [
+ {
+ "type": "TypeCastExpression",
+ "start": 2,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 3,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 5,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ }
+ }
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json
deleted file mode 100644
index 7f8da08031af..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The type cast expression is expected to be wrapped with parenthesis (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json
new file mode 100644
index 000000000000..d8bfbe9b1216
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json
@@ -0,0 +1,170 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "errors": [
+ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "ArrayExpression",
+ "start": 1,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "ArrayExpression",
+ "start": 5,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "elements": [
+ {
+ "type": "TypeCastExpression",
+ "start": 6,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 7,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "extra": {
+ "parenthesized": true,
+ "parenStart": 0
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json
deleted file mode 100644
index 23c75013dad4..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The type cast expression is expected to be wrapped with parenthesis (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json
new file mode 100644
index 000000000000..517f9d043755
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "async"
+ },
+ "name": "async"
+ },
+ "arguments": [
+ {
+ "type": "ArrayExpression",
+ "start": 7,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "elements": [
+ {
+ "type": "TypeCastExpression",
+ "start": 8,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 9,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 11,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json
deleted file mode 100644
index 3f861de320eb..000000000000
--- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "The type cast expression is expected to be wrapped with parenthesis (1:13)"
-}
diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json
new file mode 100644
index 000000000000..5ae330ce23f7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json
@@ -0,0 +1,200 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "errors": [
+ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:13)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "callee": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "async"
+ },
+ "name": "async"
+ },
+ "arguments": [
+ {
+ "type": "ArrayExpression",
+ "start": 7,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "elements": [
+ {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ {
+ "type": "ArrayExpression",
+ "start": 11,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "elements": [
+ {
+ "type": "TypeCastExpression",
+ "start": 12,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "b"
+ },
+ "name": "b"
+ },
+ "typeAnnotation": {
+ "type": "TypeAnnotation",
+ "start": 13,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "typeAnnotation": {
+ "type": "StringTypeAnnotation",
+ "start": 15,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json
deleted file mode 100644
index 182a3a9016d8..000000000000
--- a/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...>? (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json
new file mode 100644
index 000000000000..b657e0982552
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json
@@ -0,0 +1,189 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...>? (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "x"
+ },
+ "name": "x"
+ },
+ "init": {
+ "type": "JSXElement",
+ "start": 8,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "openingElement": {
+ "type": "JSXOpeningElement",
+ "start": 8,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": {
+ "type": "JSXIdentifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "name": "div"
+ },
+ "attributes": [],
+ "selfClosing": false
+ },
+ "closingElement": {
+ "type": "JSXClosingElement",
+ "start": 16,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "name": {
+ "type": "JSXIdentifier",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "name": "div"
+ }
+ },
+ "children": [
+ {
+ "type": "JSXText",
+ "start": 13,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "extra": {
+ "rawValue": "one",
+ "raw": "one"
+ },
+ "value": "one"
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "var"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/options.json b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/options.json
deleted file mode 100644
index d5960e11a308..000000000000
--- a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "JSX attributes must only be assigned a non-empty expression (1:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json
new file mode 100644
index 000000000000..a58504569cb5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json
@@ -0,0 +1,165 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: JSX attributes must only be assigned a non-empty expression (1:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "JSXElement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "openingElement": {
+ "type": "JSXOpeningElement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "JSXIdentifier",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "name": "foo"
+ },
+ "attributes": [
+ {
+ "type": "JSXAttribute",
+ "start": 5,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "JSXIdentifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "name": "bar"
+ },
+ "value": {
+ "type": "JSXExpressionContainer",
+ "start": 9,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "JSXEmptyExpression",
+ "start": 10,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ }
+ }
+ }
+ ],
+ "selfClosing": true
+ },
+ "closingElement": null,
+ "children": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/options.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/options.json
deleted file mode 100644
index 4ca478c5b41f..000000000000
--- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected corresponding JSX closing tag for <> (1:2)"
-}
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json
new file mode 100644
index 000000000000..8a88583570c3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json
@@ -0,0 +1,115 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected corresponding JSX closing tag for <> (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "JSXFragment",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "openingFragment": {
+ "type": "JSXOpeningFragment",
+ "start": 0,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ }
+ },
+ "closingFragment": {
+ "type": "JSXClosingElement",
+ "start": 2,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "JSXIdentifier",
+ "start": 4,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": "something"
+ }
+ },
+ "children": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/options.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/options.json
deleted file mode 100644
index f3afda9ee91d..000000000000
--- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected corresponding JSX closing tag for (1:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json
new file mode 100644
index 000000000000..29ab5696546f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json
@@ -0,0 +1,133 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected corresponding JSX closing tag for (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "expression": {
+ "type": "JSXElement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "openingElement": {
+ "type": "JSXOpeningElement",
+ "start": 0,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "name": {
+ "type": "JSXIdentifier",
+ "start": 1,
+ "end": 4,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 4
+ }
+ },
+ "name": "Foo"
+ },
+ "attributes": [],
+ "selfClosing": false
+ },
+ "closingElement": {
+ "type": "JSXClosingElement",
+ "start": 5,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "JSXIdentifier",
+ "start": 7,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "name": "Bar"
+ }
+ },
+ "children": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/options.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/options.json
deleted file mode 100644
index 25d9465b06be..000000000000
--- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Expected corresponding JSX closing tag for (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json
new file mode 100644
index 000000000000..63350c9eb5d8
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json
@@ -0,0 +1,117 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Expected corresponding JSX closing tag for (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "JSXElement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "openingElement": {
+ "type": "JSXOpeningElement",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "JSXIdentifier",
+ "start": 1,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "name": "something"
+ },
+ "attributes": [],
+ "selfClosing": false
+ },
+ "closingElement": {
+ "type": "JSXClosingFragment",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ "children": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/options.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/options.json
index a307a35df63e..92404e501295 100644
--- a/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/options.json
+++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/options.json
@@ -1,4 +1,3 @@
{
- "plugins": ["placeholders"],
- "throws": "Unexpected space in placeholder. (1:5)"
+ "plugins": ["placeholders"]
}
diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json
new file mode 100644
index 000000000000..4d13018c3020
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json
@@ -0,0 +1,71 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected space in placeholder. (1:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "Placeholder",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "name": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 5,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ },
+ "identifierName": "FOO"
+ },
+ "name": "FOO"
+ },
+ "expectedNode": "Statement"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/options.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/options.json
index 2d76cfab7e2f..92404e501295 100644
--- a/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/options.json
+++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/options.json
@@ -1,4 +1,3 @@
{
- "plugins": ["placeholders"],
- "throws": "Unexpected space in placeholder. (1:2)"
+ "plugins": ["placeholders"]
}
diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json
new file mode 100644
index 000000000000..0bd5ffb6bd40
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json
@@ -0,0 +1,71 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected space in placeholder. (1:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "sourceType": "script",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "Placeholder",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "name": {
+ "type": "Identifier",
+ "start": 3,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 3
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "FOO"
+ },
+ "name": "FOO"
+ },
+ "expectedNode": "Statement"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/options.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/options.json
deleted file mode 100644
index 69d91502496d..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected type cast in parameter position. (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json
new file mode 100644
index 000000000000..84bb9f048205
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected type cast in parameter position. (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "TSAsExpression",
+ "start": 7,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 7,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 12,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 18,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/options.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/options.json
deleted file mode 100644
index 69d91502496d..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected type cast in parameter position. (1:7)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json
new file mode 100644
index 000000000000..5825bdc4db33
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected type cast in parameter position. (1:7)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": true,
+ "params": [
+ {
+ "type": "TSTypeAssertion",
+ "start": 7,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 8,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 17,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/options.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/options.json
deleted file mode 100644
index b5bdba868c9f..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected type cast in parameter position. (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json
new file mode 100644
index 000000000000..369ec9d0eb08
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected type cast in parameter position. (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "TSAsExpression",
+ "start": 1,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 1,
+ "end": 2,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/options.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/options.json
deleted file mode 100644
index b5bdba868c9f..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected type cast in parameter position. (1:1)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json
new file mode 100644
index 000000000000..52cb7ee9d5a9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Unexpected type cast in parameter position. (1:1)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 0,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "TSTypeAssertion",
+ "start": 1,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 2,
+ "end": 3,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 11,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json b/packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json
deleted file mode 100644
index 3de0ab8596c4..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'extends' list cannot be empty. (1:22)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json
new file mode 100644
index 000000000000..0fe556a129e5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json
@@ -0,0 +1,87 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: 'extends' list cannot be empty. (1:22)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSInterfaceDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 13,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "extends": [],
+ "body": {
+ "type": "TSInterfaceBody",
+ "start": 22,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json b/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json
deleted file mode 100644
index 950506446835..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'implements' list cannot be empty. (1:33)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json
new file mode 100644
index 000000000000..a84755dbbeb5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json
@@ -0,0 +1,104 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: 'implements' list cannot be empty. (1:33)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "Bar"
+ },
+ "name": "Bar"
+ },
+ "implements": [],
+ "body": {
+ "type": "ClassBody",
+ "start": 33,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json b/packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json
deleted file mode 100644
index 6751fbcc5443..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "'implements' list cannot be empty. (1:21)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json
new file mode 100644
index 000000000000..bcf3445883b0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json
@@ -0,0 +1,88 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: 'implements' list cannot be empty. (1:21)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "superClass": null,
+ "implements": [],
+ "body": {
+ "type": "ClassBody",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/options.json b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/options.json
deleted file mode 100644
index b84b0421721a..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "A parameter property may not be declared using a binding pattern. (2:16)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json
new file mode 100644
index 000000000000..9436fb7283a9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json
@@ -0,0 +1,177 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: A parameter property may not be declared using a binding pattern. (2:16)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 14,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "identifierName": "constructor"
+ },
+ "name": "constructor"
+ },
+ "computed": false,
+ "kind": "constructor",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "TSParameterProperty",
+ "start": 26,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "accessibility": "public",
+ "parameter": {
+ "type": "ArrayPattern",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "elements": []
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 37,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json
deleted file mode 100644
index 7c4adceba22a..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Private elements cannot have the 'abstract' modifier. (2:2)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json
new file mode 100644
index 000000000000..9107b0794815
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json
@@ -0,0 +1,139 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Private elements cannot have the 'abstract' modifier. (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "abstract": true,
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 17,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 21,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "abstract": true,
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 30,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json
deleted file mode 100644
index a183ce2e7550..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Private elements cannot have an accessibility modifier ('private') (2:2)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json
new file mode 100644
index 000000000000..360a75b9f7a1
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json
@@ -0,0 +1,138 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Private elements cannot have an accessibility modifier ('private') (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 12,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "accessibility": "private",
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json
deleted file mode 100644
index e6c1bebe1ab9..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Private elements cannot have an accessibility modifier ('protected') (2:2)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json
new file mode 100644
index 000000000000..60afa0c3bc76
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json
@@ -0,0 +1,138 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Private elements cannot have an accessibility modifier ('protected') (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 12,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "accessibility": "protected",
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json
deleted file mode 100644
index 7fb90279eae1..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Private elements cannot have an accessibility modifier ('public') (2:2)"
-}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json
new file mode 100644
index 000000000000..3f526e42418c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json
@@ -0,0 +1,138 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Private elements cannot have an accessibility modifier ('public') (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassPrivateProperty",
+ "start": 12,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "accessibility": "public",
+ "static": false,
+ "key": {
+ "type": "PrivateName",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "a"
+ },
+ "name": "a"
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/options.json b/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/options.json
deleted file mode 100644
index fb2831d6188b..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "A binding pattern parameter cannot be optional in an implementation signature. (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json
new file mode 100644
index 000000000000..3ef0fdc07d93
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json
@@ -0,0 +1,124 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "errors": [
+ "SyntaxError: A binding pattern parameter cannot be optional in an implementation signature. (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ },
+ "identifierName": "f"
+ },
+ "name": "f"
+ },
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "ArrayPattern",
+ "start": 11,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "elements": [],
+ "optional": true
+ },
+ {
+ "type": "ObjectPattern",
+ "start": 16,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "properties": []
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "start": 20,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/options.json
deleted file mode 100644
index 336686170eb0..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json
new file mode 100644
index 000000000000..5642df62a53c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json
@@ -0,0 +1,136 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "ClassDeclaration",
+ "start": 11,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 19,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json
new file mode 100644
index 000000000000..6d6bbe962695
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json
@@ -0,0 +1,120 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "TSEnumDeclaration",
+ "start": 11,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "members": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json
new file mode 100644
index 000000000000..c6886d19470d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 10,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 11,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "start": 20,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/options.json
deleted file mode 100644
index ee82975e59a3..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'X' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json
new file mode 100644
index 000000000000..b6b67ebef96c
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json
@@ -0,0 +1,105 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'X' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSEnumDeclaration",
+ "start": 0,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "const": true,
+ "id": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "members": []
+ },
+ {
+ "type": "TSEnumDeclaration",
+ "start": 16,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "members": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/options.json
deleted file mode 100644
index 69462b29a995..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'X' has already been declared (2:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json
new file mode 100644
index 000000000000..8518fac0e7e9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json
@@ -0,0 +1,120 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'X' has already been declared (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSEnumDeclaration",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "members": []
+ },
+ {
+ "type": "ClassDeclaration",
+ "start": 10,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 18,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/options.json
deleted file mode 100644
index c77fcb7927ac..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'X' has already been declared (2:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json
new file mode 100644
index 000000000000..8a9778e36851
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json
@@ -0,0 +1,105 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'X' has already been declared (2:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSEnumDeclaration",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "members": []
+ },
+ {
+ "type": "TSEnumDeclaration",
+ "start": 10,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "const": true,
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "members": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/options.json
deleted file mode 100644
index ee47ddce75a8..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'Foo' has already been declared (2:9)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json
new file mode 100644
index 000000000000..ab31065f580b
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json
@@ -0,0 +1,123 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'Foo' has already been declared (2:9)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSEnumDeclaration",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "members": []
+ },
+ {
+ "type": "FunctionDeclaration",
+ "start": 12,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/options.json
deleted file mode 100644
index a5f623f4e212..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'X' has already been declared (2:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json
new file mode 100644
index 000000000000..80905a927dc9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'X' has already been declared (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSEnumDeclaration",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "members": []
+ },
+ {
+ "type": "TSInterfaceDeclaration",
+ "start": 10,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "body": {
+ "type": "TSInterfaceBody",
+ "start": 22,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/options.json
deleted file mode 100644
index 4172f917bdb1..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'Foo' has already been declared (2:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json
new file mode 100644
index 000000000000..4f8b4783578a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'Foo' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSEnumDeclaration",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "members": []
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 12,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/options.json
deleted file mode 100644
index ee82975e59a3..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'X' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json
new file mode 100644
index 000000000000..e347d9e0a548
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json
@@ -0,0 +1,118 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'X' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSEnumDeclaration",
+ "start": 0,
+ "end": 9,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "members": []
+ },
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 10,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 15,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "start": 19,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/options.json
deleted file mode 100644
index 4172f917bdb1..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'Foo' has already been declared (2:4)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json
new file mode 100644
index 000000000000..4f8b4783578a
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'Foo' has already been declared (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSEnumDeclaration",
+ "start": 0,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "members": []
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 12,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/options.json
deleted file mode 100644
index 92349410e8cf..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'Foo' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json
new file mode 100644
index 000000000000..c8a1a8f8dc65
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json
@@ -0,0 +1,123 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'Foo' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "start": 0,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 9,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 15,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ },
+ {
+ "type": "TSEnumDeclaration",
+ "start": 18,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "members": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/options.json
deleted file mode 100644
index ee82975e59a3..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'X' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json
new file mode 100644
index 000000000000..63b26bca4458
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json
@@ -0,0 +1,119 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'X' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSInterfaceDeclaration",
+ "start": 0,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 10,
+ "end": 11,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "body": {
+ "type": "TSInterfaceBody",
+ "start": 12,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "body": []
+ }
+ },
+ {
+ "type": "TSEnumDeclaration",
+ "start": 15,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "X"
+ },
+ "name": "X"
+ },
+ "members": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/options.json
deleted file mode 100644
index 92349410e8cf..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'Foo' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json
new file mode 100644
index 000000000000..1c1cfb5c1696
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'Foo' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "TSEnumDeclaration",
+ "start": 9,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "members": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/options.json
deleted file mode 100644
index 336686170eb0..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:6)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json
new file mode 100644
index 000000000000..3e63a0f7f298
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json
@@ -0,0 +1,134 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:6)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ }
+ },
+ {
+ "type": "ClassDeclaration",
+ "start": 17,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 25,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json
new file mode 100644
index 000000000000..ba27b683a4b7
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json
@@ -0,0 +1,118 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ }
+ },
+ {
+ "type": "TSEnumDeclaration",
+ "start": 17,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "members": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/options.json
deleted file mode 100644
index 04242bd1565b..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:10)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json
new file mode 100644
index 000000000000..4983be36642d
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json
@@ -0,0 +1,133 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:10)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ }
+ },
+ {
+ "type": "TSInterfaceDeclaration",
+ "start": 17,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "body": {
+ "type": "TSInterfaceBody",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "body": []
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/options.json
deleted file mode 100644
index 1eed93f49a0e..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'A' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json
new file mode 100644
index 000000000000..02fde75620f0
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json
@@ -0,0 +1,132 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'A' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 0,
+ "end": 16,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 6,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "start": 9,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ }
+ },
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 17,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 22,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 26,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/options.json
deleted file mode 100644
index 92349410e8cf..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Identifier 'Foo' has already been declared (2:5)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json
new file mode 100644
index 000000000000..1c1cfb5c1696
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json
@@ -0,0 +1,122 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "errors": [
+ "SyntaxError: Identifier 'Foo' has already been declared (2:5)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ },
+ {
+ "type": "TSEnumDeclaration",
+ "start": 9,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "identifierName": "Foo"
+ },
+ "name": "Foo"
+ },
+ "members": []
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/options.json b/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/options.json
deleted file mode 100644
index 856a8477d1ca..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["typescript"],
- "throws": "Template literal types cannot have any substitution (1:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json
new file mode 100644
index 000000000000..ee3c9e5da012
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json
@@ -0,0 +1,195 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "errors": [
+ "SyntaxError: Template literal types cannot have any substitution (1:14)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 20,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ },
+ "identifierName": "x"
+ },
+ "name": "x",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 5,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSLiteralType",
+ "start": 7,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "literal": {
+ "type": "TemplateLiteral",
+ "start": 7,
+ "end": 19,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "expressions": [
+ {
+ "type": "Identifier",
+ "start": 14,
+ "end": 17,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ }
+ ],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 8,
+ "end": 12,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": {
+ "raw": "foo-",
+ "cooked": "foo-"
+ },
+ "tail": false
+ },
+ {
+ "type": "TemplateElement",
+ "start": 18,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": {
+ "raw": "",
+ "cooked": ""
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ }
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-1/options.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-1/options.json
deleted file mode 100644
index 0a91d0015278..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/types/read-only-1/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["typescript"],
- "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json
new file mode 100644
index 000000000000..ced722e79dd3
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json
@@ -0,0 +1,137 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "errors": [
+ "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 0,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "T30"
+ },
+ "name": "T30"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeOperator",
+ "start": 11,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "operator": "readonly",
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 20,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ },
+ "trailingComments": [
+ {
+ "type": "CommentLine",
+ "value": " Error",
+ "start": 29,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": " Error",
+ "start": 29,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-2/options.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-2/options.json
deleted file mode 100644
index 0a91d0015278..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/types/read-only-2/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["typescript"],
- "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json
new file mode 100644
index 000000000000..73c4d7d4cd3f
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json
@@ -0,0 +1,154 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "errors": [
+ "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 0,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "T31"
+ },
+ "name": "T31"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeOperator",
+ "start": 11,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "operator": "readonly",
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ },
+ "identifierName": "T"
+ },
+ "name": "T"
+ }
+ }
+ },
+ "trailingComments": [
+ {
+ "type": "CommentLine",
+ "value": " Error",
+ "start": 24,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": " Error",
+ "start": 24,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-3/options.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-3/options.json
deleted file mode 100644
index 0a91d0015278..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/types/read-only-3/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["typescript"],
- "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json
new file mode 100644
index 000000000000..8a977f1e3987
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json
@@ -0,0 +1,168 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "errors": [
+ "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 0,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 38
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "T32"
+ },
+ "name": "T32"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeOperator",
+ "start": 11,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "operator": "readonly",
+ "typeAnnotation": {
+ "type": "TSTypeOperator",
+ "start": 20,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "operator": "readonly",
+ "typeAnnotation": {
+ "type": "TSArrayType",
+ "start": 29,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "elementType": {
+ "type": "TSStringKeyword",
+ "start": 29,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ }
+ }
+ }
+ },
+ "trailingComments": [
+ {
+ "type": "CommentLine",
+ "value": " Error",
+ "start": 40,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": " Error",
+ "start": 40,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 40
+ },
+ "end": {
+ "line": 1,
+ "column": 48
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-4/options.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-4/options.json
deleted file mode 100644
index 0a91d0015278..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/types/read-only-4/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["typescript"],
- "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json
new file mode 100644
index 000000000000..0e0dd2eb9f49
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json
@@ -0,0 +1,186 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "errors": [
+ "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "start": 0,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 5,
+ "end": 8,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ },
+ "identifierName": "T33"
+ },
+ "name": "T33"
+ },
+ "typeAnnotation": {
+ "type": "TSTypeOperator",
+ "start": 11,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "operator": "readonly",
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "start": 20,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ },
+ "identifierName": "Array"
+ },
+ "name": "Array"
+ },
+ "typeParameters": {
+ "type": "TSTypeParameterInstantiation",
+ "start": 25,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "params": [
+ {
+ "type": "TSStringKeyword",
+ "start": 26,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+ "trailingComments": [
+ {
+ "type": "CommentLine",
+ "value": " Error",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "directives": []
+ },
+ "comments": [
+ {
+ "type": "CommentLine",
+ "value": " Error",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/options.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/options.json
deleted file mode 100644
index 15111b29065f..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/options.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "sourceType": "module",
- "plugins": ["typescript"],
- "throws": "A required element cannot follow an optional element. (1:17)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json
new file mode 100644
index 000000000000..b66ac1ec7326
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json
@@ -0,0 +1,166 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "errors": [
+ "SyntaxError: A required element cannot follow an optional element. (1:17)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 0,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 4,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ },
+ "identifierName": "x"
+ },
+ "name": "x",
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 5,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTupleType",
+ "start": 7,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "elementTypes": [
+ {
+ "type": "TSOptionalType",
+ "start": 8,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 8,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ }
+ },
+ {
+ "type": "TSNumberKeyword",
+ "start": 17,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+ "init": null
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json b/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json
index 57893e4eee56..c4c1edaca3c6 100644
--- a/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json
+++ b/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Complex binding patterns require an initialization value (1:6)"
+ "throws": "Unexpected token, expected \";\" (1:6)"
}
diff --git a/packages/babel-parser/test/helpers/runFixtureTests.js b/packages/babel-parser/test/helpers/runFixtureTests.js
index 9e97ee46f727..f08ed2312101 100644
--- a/packages/babel-parser/test/helpers/runFixtureTests.js
+++ b/packages/babel-parser/test/helpers/runFixtureTests.js
@@ -107,11 +107,19 @@ export function runThrowTestsWithEstree(fixturesPath, parseFunction) {
}
function save(test, ast) {
- // Ensure that RegExp are serialized as strings
- const toJSON = RegExp.prototype.toJSON;
- RegExp.prototype.toJSON = RegExp.prototype.toString;
- require("fs").writeFileSync(test.expect.loc, JSON.stringify(ast, null, " "));
- RegExp.prototype.toJSON = toJSON;
+ // Ensure that RegExp and Errors are serialized as strings
+ forceToString(RegExp, () =>
+ forceToString(Error, () =>
+ fs.writeFileSync(test.expect.loc, JSON.stringify(ast, null, " ")),
+ ),
+ );
+}
+
+function forceToString(obj, cb) {
+ const { toJSON } = obj.prototype;
+ obj.prototype.toJSON = obj.prototype.toString;
+ cb();
+ obj.prototype.toJSON = toJSON;
}
function runTest(test, parseFunction) {
@@ -125,7 +133,7 @@ function runTest(test, parseFunction) {
let ast;
try {
- ast = parseFunction(test.actual.code, opts);
+ ast = parseFunction(test.actual.code, { errorRecovery: true, ...opts });
} catch (err) {
if (opts.throws) {
if (err.message === opts.throws) {
@@ -152,6 +160,7 @@ function runTest(test, parseFunction) {
}
if (ast.comments && !ast.comments.length) delete ast.comments;
+ if (ast.errors && !ast.errors.length) delete ast.errors;
if (!test.expect.code && !opts.throws && !process.env.CI) {
test.expect.loc += "on";
@@ -159,6 +168,20 @@ function runTest(test, parseFunction) {
}
if (opts.throws) {
+ if (process.env.OVERWRITE) {
+ const fn = path.dirname(test.expect.loc) + "/options.json";
+ test.options = test.options || {};
+ delete test.options.throws;
+ const contents = JSON.stringify(test.options, null, " ");
+ if (contents === "{}") {
+ fs.unlinkSync(fn);
+ } else {
+ fs.writeFileSync(fn, JSON.stringify(test.options, null, " "));
+ }
+ test.expect.loc += "on";
+ return save(test, ast);
+ }
+
throw new Error(
"Expected error message: " + opts.throws + ". But parsing succeeded.",
);
@@ -175,7 +198,7 @@ function runTest(test, parseFunction) {
}
function ppJSON(v) {
- v = v instanceof RegExp ? v.toString() : v;
+ v = v instanceof RegExp || v instanceof Error ? v.toString() : v;
return JSON.stringify(v, null, 2);
}
@@ -188,7 +211,12 @@ function addPath(str, pt) {
}
function misMatch(exp, act) {
- if (exp instanceof RegExp || act instanceof RegExp) {
+ if (
+ exp instanceof RegExp ||
+ act instanceof RegExp ||
+ exp instanceof Error ||
+ act instanceof Error
+ ) {
const left = ppJSON(exp);
const right = ppJSON(act);
if (left !== right) return left + " !== " + right;
diff --git a/packages/babel-preset-typescript/test/fixtures/jsx-compat/ts-invalid/options.json b/packages/babel-preset-typescript/test/fixtures/jsx-compat/ts-invalid/options.json
index 4c0aa124656f..c11cb6fdfbdf 100644
--- a/packages/babel-preset-typescript/test/fixtures/jsx-compat/ts-invalid/options.json
+++ b/packages/babel-preset-typescript/test/fixtures/jsx-compat/ts-invalid/options.json
@@ -1,3 +1,3 @@
{
- "throws": "Unexpected token, expected \">/<=/>=\" (1:6)"
+ "throws": "Unexpected token, expected \",\" (1:6)"
}
From e9c1bce50f590c484e9ba7cc0b19caa88e66659d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?=
Date: Tue, 5 Nov 2019 10:56:57 +0100
Subject: [PATCH 041/648] Add support for TS declare modifier on fields
(#10545)
* [parser] Add support for TS declare modifier on fields (#10484)
* [parser] Add support for TS declare modifier on fields
* Use Object.create(null)
* Comment
* Add support for TS declare types to types and generator (#10544)
* Transform TypeScript "declare" fields (#10546)
* Transform TypeScript "declare" fields
* Remove multiple spaces
* declareFields -> allowDeclareFields
* Update after rebase
---
.../babel-generator/src/generators/classes.js | 39 +---
.../src/generators/typescript.js | 23 +++
.../typescript/class-field-declare/input.js | 5 +
.../class-field-declare/options.json | 4 +
.../typescript/class-field-declare/output.js | 5 +
.../src/fields.js | 4 +
.../src/typescript.js | 19 ++
.../src/plugins/typescript/index.js | 115 +++++++----
packages/babel-parser/src/types.js | 21 +-
.../class/declare-field-initializer/input.ts | 3 +
.../declare-field-initializer/output.json | 170 ++++++++++++++++
.../typescript/class/declare-field/input.ts | 4 +
.../class/declare-field/output.json | 187 ++++++++++++++++++
.../typescript/class/declare-method/input.ts | 3 +
.../class/declare-method/output.json | 145 ++++++++++++++
.../class/method-readonly/options.json | 3 -
.../class/method-readonly/output.json | 145 ++++++++++++++
.../output.json | 4 +-
.../src/index.js | 158 ++++++++-------
.../class/declare-not-enabled/input.ts | 3 +
.../class/declare-not-enabled/options.json | 4 +
.../class/declare-not-initialized/input.ts | 3 +
.../declare-not-initialized/options.json | 3 +
.../class/declare-not-initialized/output.js | 3 +
.../test/fixtures/class/declare/input.ts | 3 +
.../test/fixtures/class/declare/options.json | 3 +
.../test/fixtures/class/declare/output.js | 1 +
.../test/fixtures/class/properties/input.ts | 3 +-
.../input.ts | 4 +
.../options.json | 7 +
.../transform-properties-declare/input.ts | 4 +
.../transform-properties-declare/options.json | 6 +
.../transform-properties-declare/output.js | 8 +
.../input.ts | 3 +
.../options.json | 3 +
.../output.js | 1 +
packages/babel-preset-typescript/src/index.js | 28 +--
.../src/definitions/experimental.js | 4 +
38 files changed, 985 insertions(+), 166 deletions(-)
create mode 100644 packages/babel-generator/test/fixtures/typescript/class-field-declare/input.js
create mode 100644 packages/babel-generator/test/fixtures/typescript/class-field-declare/options.json
create mode 100644 packages/babel-generator/test/fixtures/typescript/class-field-declare/output.js
create mode 100644 packages/babel-helper-create-class-features-plugin/src/typescript.js
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/declare-field/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/declare-method/input.ts
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json
delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/method-readonly/options.json
create mode 100644 packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-enabled/input.ts
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-enabled/options.json
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/input.ts
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/options.json
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/output.js
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/declare/input.ts
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/declare/options.json
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/declare/output.js
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare-wrong-order/input.ts
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare-wrong-order/options.json
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/input.ts
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/options.json
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/output.js
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/input.ts
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/options.json
create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/output.js
diff --git a/packages/babel-generator/src/generators/classes.js b/packages/babel-generator/src/generators/classes.js
index e8c62339a6d2..1713293369d4 100644
--- a/packages/babel-generator/src/generators/classes.js
+++ b/packages/babel-generator/src/generators/classes.js
@@ -71,26 +71,8 @@ export function ClassBody(node: Object) {
export function ClassProperty(node: Object) {
this.printJoin(node.decorators, node);
+ this.tsPrintClassMemberModifiers(node, /* isField */ true);
- if (node.accessibility) {
- // TS
- this.word(node.accessibility);
- this.space();
- }
- if (node.static) {
- this.word("static");
- this.space();
- }
- if (node.abstract) {
- // TS
- this.word("abstract");
- this.space();
- }
- if (node.readonly) {
- // TS
- this.word("readonly");
- this.space();
- }
if (node.computed) {
this.token("[");
this.print(node.key, node);
@@ -148,23 +130,6 @@ export function ClassPrivateMethod(node: Object) {
export function _classMethodHead(node) {
this.printJoin(node.decorators, node);
-
- if (node.accessibility) {
- // TS
- this.word(node.accessibility);
- this.space();
- }
-
- if (node.abstract) {
- // TS
- this.word("abstract");
- this.space();
- }
-
- if (node.static) {
- this.word("static");
- this.space();
- }
-
+ this.tsPrintClassMemberModifiers(node, /* isField */ false);
this._methodHead(node);
}
diff --git a/packages/babel-generator/src/generators/typescript.js b/packages/babel-generator/src/generators/typescript.js
index a201a5d5d658..39c580d74d2f 100644
--- a/packages/babel-generator/src/generators/typescript.js
+++ b/packages/babel-generator/src/generators/typescript.js
@@ -556,3 +556,26 @@ export function tsPrintSignatureDeclarationBase(node) {
this.token(")");
this.print(node.typeAnnotation, node);
}
+
+export function tsPrintClassMemberModifiers(node, isField) {
+ if (isField && node.declare) {
+ this.word("declare");
+ this.space();
+ }
+ if (node.accessibility) {
+ this.word(node.accessibility);
+ this.space();
+ }
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+ if (node.abstract) {
+ this.word("abstract");
+ this.space();
+ }
+ if (isField && node.readonly) {
+ this.word("readonly");
+ this.space();
+ }
+}
diff --git a/packages/babel-generator/test/fixtures/typescript/class-field-declare/input.js b/packages/babel-generator/test/fixtures/typescript/class-field-declare/input.js
new file mode 100644
index 000000000000..0e524a92bb8a
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/typescript/class-field-declare/input.js
@@ -0,0 +1,5 @@
+class A {
+ declare foo;
+ declare bar: string;
+ declare readonly bax: number;
+}
diff --git a/packages/babel-generator/test/fixtures/typescript/class-field-declare/options.json b/packages/babel-generator/test/fixtures/typescript/class-field-declare/options.json
new file mode 100644
index 000000000000..9f3a0c2c0ff1
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/typescript/class-field-declare/options.json
@@ -0,0 +1,4 @@
+{
+ "sourceType": "module",
+ "plugins": ["typescript", "classProperties"]
+}
diff --git a/packages/babel-generator/test/fixtures/typescript/class-field-declare/output.js b/packages/babel-generator/test/fixtures/typescript/class-field-declare/output.js
new file mode 100644
index 000000000000..d1d7b1be56aa
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/typescript/class-field-declare/output.js
@@ -0,0 +1,5 @@
+class A {
+ declare foo;
+ declare bar: string;
+ declare readonly bax: number;
+}
\ No newline at end of file
diff --git a/packages/babel-helper-create-class-features-plugin/src/fields.js b/packages/babel-helper-create-class-features-plugin/src/fields.js
index 4cdaccd1bbb5..167e894cae33 100644
--- a/packages/babel-helper-create-class-features-plugin/src/fields.js
+++ b/packages/babel-helper-create-class-features-plugin/src/fields.js
@@ -5,6 +5,8 @@ import ReplaceSupers, {
import memberExpressionToFunctions from "@babel/helper-member-expression-to-functions";
import optimiseCall from "@babel/helper-optimise-call-expression";
+import * as ts from "./typescript";
+
export function buildPrivateNamesMap(props) {
const privateNamesMap = new Map();
for (const prop of props) {
@@ -556,6 +558,8 @@ export function buildFieldsInitNodes(
let needsClassRef = false;
for (const prop of props) {
+ ts.assertFieldTransformed(prop);
+
const isStatic = prop.node.static;
const isInstance = !isStatic;
const isPrivate = prop.isPrivate();
diff --git a/packages/babel-helper-create-class-features-plugin/src/typescript.js b/packages/babel-helper-create-class-features-plugin/src/typescript.js
new file mode 100644
index 000000000000..c18f0ea17389
--- /dev/null
+++ b/packages/babel-helper-create-class-features-plugin/src/typescript.js
@@ -0,0 +1,19 @@
+// @flow
+
+import type { NodePath } from "@babel/traverse";
+
+export function assertFieldTransformed(path: NodePath) {
+ // TODO (Babel 8): Also check path.node.definite
+
+ if (path.node.declare) {
+ throw path.buildCodeFrameError(
+ `TypeScript 'declare' fields must first be transformed by ` +
+ `@babel/plugin-transform-typescript.\n` +
+ `If you have already enabled that plugin (or '@babel/preset-typescript'), make sure ` +
+ `that it runs before any plugin related to additional class features:\n` +
+ ` - @babel/plugin-proposal-class-properties\n` +
+ ` - @babel/plugin-proposal-private-methods\n` +
+ ` - @babel/plugin-proposal-decorators`,
+ );
+ }
+}
diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js
index e5d461b55e46..9fabb50cd0a2 100644
--- a/packages/babel-parser/src/plugins/typescript/index.js
+++ b/packages/babel-parser/src/plugins/typescript/index.js
@@ -28,6 +28,7 @@ import * as charCodes from "charcodes";
type TsModifier =
| "readonly"
| "abstract"
+ | "declare"
| "static"
| "public"
| "private"
@@ -129,6 +130,31 @@ export default (superClass: Class): Class =>
return undefined;
}
+ /** Parses a list of modifiers, in any order.
+ * If you need a specific order, you must call this function multiple times:
+ * this.tsParseModifiers(["public"]);
+ * this.tsParseModifiers(["abstract", "readonly"]);
+ */
+ tsParseModifiers(
+ allowedModifiers: T[],
+ ): { [key: TsModifier]: ?true, __proto__: null } {
+ const modifiers = Object.create(null);
+
+ while (true) {
+ const startPos = this.state.start;
+ const modifier: ?T = this.tsParseModifier(allowedModifiers);
+
+ if (!modifier) break;
+
+ if (Object.hasOwnProperty.call(modifiers, modifier)) {
+ this.raise(startPos, `Duplicate modifier: '${modifier}'`);
+ }
+ modifiers[modifier] = true;
+ }
+
+ return modifiers;
+ }
+
tsIsListTerminator(kind: ParsingContext): boolean {
switch (kind) {
case "EnumMembers":
@@ -405,7 +431,7 @@ export default (superClass: Class): Class =>
return this.eat(tt.name) && this.match(tt.colon);
}
- tsTryParseIndexSignature(node: N.TsIndexSignature): ?N.TsIndexSignature {
+ tsTryParseIndexSignature(node: N.Node): ?N.TsIndexSignature {
if (
!(
this.match(tt.bracketL) &&
@@ -1844,50 +1870,49 @@ export default (superClass: Class): Class =>
parseClassMemberWithIsStatic(
classBody: N.ClassBody,
- member: any,
+ member: N.ClassMember | N.TsIndexSignature,
state: { hadConstructor: boolean },
isStatic: boolean,
constructorAllowsSuper: boolean,
): void {
- const methodOrProp: N.ClassMethod | N.ClassProperty = member;
- const prop: N.ClassProperty = member;
- const propOrIdx: N.ClassProperty | N.TsIndexSignature = member;
-
- let abstract = false,
- readonly = false;
-
- const mod = this.tsParseModifier(["abstract", "readonly"]);
- switch (mod) {
- case "readonly":
- readonly = true;
- abstract = !!this.tsParseModifier(["abstract"]);
- break;
- case "abstract":
- abstract = true;
- readonly = !!this.tsParseModifier(["readonly"]);
- break;
- }
+ const modifiers = this.tsParseModifiers([
+ "abstract",
+ "readonly",
+ "declare",
+ ]);
- if (abstract) methodOrProp.abstract = true;
- if (readonly) propOrIdx.readonly = true;
+ Object.assign(member, modifiers);
- if (!abstract && !isStatic && !methodOrProp.accessibility) {
- const idx = this.tsTryParseIndexSignature(member);
- if (idx) {
- classBody.body.push(idx);
- return;
+ const idx = this.tsTryParseIndexSignature(member);
+ if (idx) {
+ classBody.body.push(idx);
+
+ if (modifiers.abstract) {
+ this.raise(
+ member.start,
+ "Index signatures cannot have the 'abstract' modifier",
+ );
+ }
+ if (isStatic) {
+ this.raise(
+ member.start,
+ "Index signatures cannot have the 'static' modifier",
+ );
+ }
+ if ((member: any).accessibility) {
+ this.raise(
+ member.start,
+ `Index signatures cannot have an accessibility modifier ('${
+ (member: any).accessibility
+ }')`,
+ );
}
- }
- if (readonly) {
- // Must be a property (if not an index signature).
- methodOrProp.static = isStatic;
- this.parseClassPropertyName(prop);
- this.parsePostMemberNameModifiers(methodOrProp);
- this.pushClassProperty(classBody, prop);
return;
}
+ /*:: invariant(member.type !== "TSIndexSignature") */
+
super.parseClassMemberWithIsStatic(
classBody,
member,
@@ -1902,6 +1927,20 @@ export default (superClass: Class): Class =>
): void {
const optional = this.eat(tt.question);
if (optional) methodOrProp.optional = true;
+
+ if ((methodOrProp: any).readonly && this.match(tt.parenL)) {
+ this.raise(
+ methodOrProp.start,
+ "Class methods cannot have the 'readonly' modifier",
+ );
+ }
+
+ if ((methodOrProp: any).declare && this.match(tt.parenL)) {
+ this.raise(
+ methodOrProp.start,
+ "Class methods cannot have the 'declare' modifier",
+ );
+ }
}
// Note: The reason we do this in `parseExpressionStatement` and not `parseStatement`
@@ -2048,6 +2087,14 @@ export default (superClass: Class): Class =>
parseClassProperty(node: N.ClassProperty): N.ClassProperty {
this.parseClassPropertyAnnotation(node);
+
+ if (node.declare && this.match(tt.equal)) {
+ this.raise(
+ this.state.start,
+ "'declare' class fields cannot have an initializer",
+ );
+ }
+
return super.parseClassProperty(node);
}
diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js
index f5b34a2db0a3..8392a58db0f2 100644
--- a/packages/babel-parser/src/types.js
+++ b/packages/babel-parser/src/types.js
@@ -743,18 +743,19 @@ export type ClassPrivateMethod = NodeBase &
computed: false,
};
-export type ClassProperty = ClassMemberBase & {
- type: "ClassProperty",
- key: Expression,
- value: ?Expression, // TODO: Not in spec that this is nullable.
+export type ClassProperty = ClassMemberBase &
+ DeclarationBase & {
+ type: "ClassProperty",
+ key: Expression,
+ value: ?Expression, // TODO: Not in spec that this is nullable.
- typeAnnotation?: ?TypeAnnotationBase, // TODO: Not in spec
- variance?: ?FlowVariance, // TODO: Not in spec
+ typeAnnotation?: ?TypeAnnotationBase, // TODO: Not in spec
+ variance?: ?FlowVariance, // TODO: Not in spec
- // TypeScript only: (TODO: Not in spec)
- readonly?: true,
- definite?: true,
-};
+ // TypeScript only: (TODO: Not in spec)
+ readonly?: true,
+ definite?: true,
+ };
export type ClassPrivateProperty = NodeBase & {
type: "ClassPrivateProperty",
diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/input.ts b/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/input.ts
new file mode 100644
index 000000000000..b77a17738bf5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/input.ts
@@ -0,0 +1,3 @@
+class A {
+ declare bar: string = "test";
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json
new file mode 100644
index 000000000000..fb27f3055064
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json
@@ -0,0 +1,170 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 12,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "declare": true,
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 23,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 25,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ }
+ }
+ },
+ "value": {
+ "type": "StringLiteral",
+ "start": 34,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "extra": {
+ "rawValue": "test",
+ "raw": "\"test\""
+ },
+ "value": "test"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field/input.ts b/packages/babel-parser/test/fixtures/typescript/class/declare-field/input.ts
new file mode 100644
index 000000000000..a7a8b2d36280
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field/input.ts
@@ -0,0 +1,4 @@
+class A {
+ declare foo;
+ declare bar: string;
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json
new file mode 100644
index 000000000000..746e2964f438
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json
@@ -0,0 +1,187 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassProperty",
+ "start": 12,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "declare": true,
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "value": null
+ },
+ {
+ "type": "ClassProperty",
+ "start": 27,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "declare": true,
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ },
+ "identifierName": "bar"
+ },
+ "name": "bar"
+ },
+ "computed": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "start": 38,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "start": 40,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ }
+ }
+ },
+ "value": null
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-method/input.ts b/packages/babel-parser/test/fixtures/typescript/class/declare-method/input.ts
new file mode 100644
index 000000000000..0e539a84a2a5
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/declare-method/input.ts
@@ -0,0 +1,3 @@
+class A {
+ declare foo() {}
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json
new file mode 100644
index 000000000000..0219c43119d2
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json
@@ -0,0 +1,145 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Class methods cannot have the 'declare' modifier (2:2)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "A"
+ },
+ "name": "A"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 12,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "declare": true,
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 20,
+ "end": 23,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "identifierName": "foo"
+ },
+ "name": "foo"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-readonly/options.json b/packages/babel-parser/test/fixtures/typescript/class/method-readonly/options.json
deleted file mode 100644
index f7dd2e27ef2c..000000000000
--- a/packages/babel-parser/test/fixtures/typescript/class/method-readonly/options.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "throws": "Unexpected token, expected \";\" (2:14)"
-}
diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json
new file mode 100644
index 000000000000..198e2e1cf0c9
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json
@@ -0,0 +1,145 @@
+{
+ "type": "File",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "errors": [
+ "SyntaxError: Class methods cannot have the 'readonly' modifier (2:4)"
+ ],
+ "program": {
+ "type": "Program",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "sourceType": "module",
+ "interpreter": null,
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "start": 0,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 6,
+ "end": 7,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ },
+ "identifierName": "C"
+ },
+ "name": "C"
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "start": 8,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "body": [
+ {
+ "type": "ClassMethod",
+ "start": 14,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "readonly": true,
+ "static": false,
+ "key": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "identifierName": "m"
+ },
+ "name": "m"
+ },
+ "computed": false,
+ "kind": "method",
+ "id": null,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 27,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "body": [],
+ "directives": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "directives": []
+ }
+}
\ No newline at end of file
diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json
index f883e0b00b2a..456ca59ae4ae 100644
--- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json
+++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json
@@ -77,7 +77,7 @@
},
"body": [
{
- "type": "ClassProperty",
+ "type": "ClassPrivateProperty",
"start": 12,
"end": 24,
"loc": {
@@ -127,7 +127,7 @@
"value": null
},
{
- "type": "ClassProperty",
+ "type": "ClassPrivateProperty",
"start": 27,
"end": 47,
"loc": {
diff --git a/packages/babel-plugin-transform-typescript/src/index.js b/packages/babel-plugin-transform-typescript/src/index.js
index c89e2dbe8185..ed7d927fe595 100644
--- a/packages/babel-plugin-transform-typescript/src/index.js
+++ b/packages/babel-plugin-transform-typescript/src/index.js
@@ -44,11 +44,94 @@ function registerGlobalType(programScope, name) {
}
export default declare(
- (api, { jsxPragma = "React", allowNamespaces = false }) => {
+ (
+ api,
+ {
+ jsxPragma = "React",
+ allowNamespaces = false,
+ allowDeclareFields = false,
+ },
+ ) => {
api.assertVersion(7);
const JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/;
+ const classMemberVisitors = {
+ field(path) {
+ const { node } = path;
+
+ if (!allowDeclareFields && node.declare) {
+ throw path.buildCodeFrameError(
+ `The 'declare' modifier is only allowed when the 'allowDeclareFields' option of ` +
+ `@babel/plugin-transform-typescript or @babel/preset-typescript is enabled.`,
+ );
+ }
+ if (node.definite || node.declare) {
+ if (node.value) {
+ throw path.buildCodeFrameError(
+ `Definietly assigned fields and fields with the 'declare' modifier cannot` +
+ ` be initialized here, but only in the constructor`,
+ );
+ }
+
+ path.remove();
+ } else if (!allowDeclareFields && !node.value && !node.decorators) {
+ path.remove();
+ }
+
+ if (node.accessibility) node.accessibility = null;
+ if (node.abstract) node.abstract = null;
+ if (node.readonly) node.readonly = null;
+ if (node.optional) node.optional = null;
+ if (node.typeAnnotation) node.typeAnnotation = null;
+ },
+ method({ node }) {
+ if (node.accessibility) node.accessibility = null;
+ if (node.abstract) node.abstract = null;
+ if (node.optional) node.optional = null;
+
+ // Rest handled by Function visitor
+ },
+ constructor(path, classPath) {
+ // Collects parameter properties so that we can add an assignment
+ // for each of them in the constructor body
+ //
+ // We use a WeakSet to ensure an assignment for a parameter
+ // property is only added once. This is necessary for cases like
+ // using `transform-classes`, which causes this visitor to run
+ // twice.
+ const parameterProperties = [];
+ for (const param of path.node.params) {
+ if (
+ param.type === "TSParameterProperty" &&
+ !PARSED_PARAMS.has(param.parameter)
+ ) {
+ PARSED_PARAMS.add(param.parameter);
+ parameterProperties.push(param.parameter);
+ }
+ }
+
+ if (parameterProperties.length) {
+ const assigns = parameterProperties.map(p => {
+ let id;
+ if (t.isIdentifier(p)) {
+ id = p;
+ } else if (t.isAssignmentPattern(p) && t.isIdentifier(p.left)) {
+ id = p.left;
+ } else {
+ throw path.buildCodeFrameError(
+ "Parameter properties can not be destructuring patterns.",
+ );
+ }
+
+ return template.statement.ast`this.${id} = ${id}`;
+ });
+
+ injectInitialization(classPath, path, assigns);
+ }
+ },
+ };
+
return {
name: "transform-typescript",
inherits: syntaxTypeScript,
@@ -192,27 +275,6 @@ export default declare(
if (node.definite) node.definite = null;
},
- ClassMethod(path) {
- const { node } = path;
-
- if (node.accessibility) node.accessibility = null;
- if (node.abstract) node.abstract = null;
- if (node.optional) node.optional = null;
-
- // Rest handled by Function visitor
- },
-
- ClassProperty(path) {
- const { node } = path;
-
- if (node.accessibility) node.accessibility = null;
- if (node.abstract) node.abstract = null;
- if (node.readonly) node.readonly = null;
- if (node.optional) node.optional = null;
- if (node.definite) node.definite = null;
- if (node.typeAnnotation) node.typeAnnotation = null;
- },
-
TSIndexSignature(path) {
path.remove();
},
@@ -238,54 +300,14 @@ export default declare(
// class transform would transform the class, causing more specific
// visitors to not run.
path.get("body.body").forEach(child => {
- const childNode = child.node;
-
- if (t.isClassMethod(childNode, { kind: "constructor" })) {
- // Collects parameter properties so that we can add an assignment
- // for each of them in the constructor body
- //
- // We use a WeakSet to ensure an assignment for a parameter
- // property is only added once. This is necessary for cases like
- // using `transform-classes`, which causes this visitor to run
- // twice.
- const parameterProperties = [];
- for (const param of childNode.params) {
- if (
- param.type === "TSParameterProperty" &&
- !PARSED_PARAMS.has(param.parameter)
- ) {
- PARSED_PARAMS.add(param.parameter);
- parameterProperties.push(param.parameter);
- }
- }
-
- if (parameterProperties.length) {
- const assigns = parameterProperties.map(p => {
- let id;
- if (t.isIdentifier(p)) {
- id = p;
- } else if (
- t.isAssignmentPattern(p) &&
- t.isIdentifier(p.left)
- ) {
- id = p.left;
- } else {
- throw path.buildCodeFrameError(
- "Parameter properties can not be destructuring patterns.",
- );
- }
-
- return template.statement.ast`this.${id} = ${id}`;
- });
-
- injectInitialization(path, child, assigns);
+ if (child.isClassMethod()) {
+ if (child.node.kind === "constructor") {
+ classMemberVisitors.constructor(child, path);
+ } else {
+ classMemberVisitors.method(child, path);
}
} else if (child.isClassProperty()) {
- childNode.typeAnnotation = null;
-
- if (!childNode.value && !childNode.decorators) {
- child.remove();
- }
+ classMemberVisitors.field(child, path);
}
});
},
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-enabled/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-enabled/input.ts
new file mode 100644
index 000000000000..3cb9d54665fa
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-enabled/input.ts
@@ -0,0 +1,3 @@
+class A {
+ declare x;
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-enabled/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-enabled/options.json
new file mode 100644
index 000000000000..c844b0ad736c
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-enabled/options.json
@@ -0,0 +1,4 @@
+{
+ "plugins": ["transform-typescript"],
+ "throws": "The 'declare' modifier is only allowed when the 'allowDeclareFields' option of @babel/plugin-transform-typescript or @babel/preset-typescript is enabled."
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/input.ts
new file mode 100644
index 000000000000..c7c42323a390
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/input.ts
@@ -0,0 +1,3 @@
+class A {
+ x;
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/options.json
new file mode 100644
index 000000000000..a6d406a50e49
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/options.json
@@ -0,0 +1,3 @@
+{
+ "plugins": [["transform-typescript", { "allowDeclareFields": true }]]
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/output.js
new file mode 100644
index 000000000000..eebf5c5c33db
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare-not-initialized/output.js
@@ -0,0 +1,3 @@
+class A {
+ x;
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/input.ts
new file mode 100644
index 000000000000..7ab37b71fb39
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/input.ts
@@ -0,0 +1,3 @@
+class A {
+ declare x;
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/options.json
new file mode 100644
index 000000000000..a6d406a50e49
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/options.json
@@ -0,0 +1,3 @@
+{
+ "plugins": [["transform-typescript", { "allowDeclareFields": true }]]
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/output.js
new file mode 100644
index 000000000000..a869c2849526
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/declare/output.js
@@ -0,0 +1 @@
+class A {}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/input.ts
index abb53ac69bc3..b59f26e0c387 100644
--- a/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/input.ts
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/input.ts
@@ -1,7 +1,8 @@
class C {
public a?: number;
private b: number = 0;
- readonly c!: number = 1;
+ readonly c: number = 1;
@foo d: number;
@foo e: number = 3;
+ f!: number;
}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare-wrong-order/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare-wrong-order/input.ts
new file mode 100644
index 000000000000..afc220470140
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare-wrong-order/input.ts
@@ -0,0 +1,4 @@
+class A {
+ declare x;
+ y;
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare-wrong-order/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare-wrong-order/options.json
new file mode 100644
index 000000000000..8a07f1cc2003
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare-wrong-order/options.json
@@ -0,0 +1,7 @@
+{
+ "plugins": [
+ "proposal-class-properties",
+ ["transform-typescript", { "allowDeclareFields": true }]
+ ],
+ "throws": "TypeScript 'declare' fields must first be transformed by @babel/plugin-transform-typescript.\nIf you have already enabled that plugin (or '@babel/preset-typescript'), make sure that it runs before any plugin related to additional class features:\n - @babel/plugin-proposal-class-properties\n - @babel/plugin-proposal-private-methods\n - @babel/plugin-proposal-decorators"
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/input.ts
new file mode 100644
index 000000000000..afc220470140
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/input.ts
@@ -0,0 +1,4 @@
+class A {
+ declare x;
+ y;
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/options.json
new file mode 100644
index 000000000000..18a1de9a1531
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/options.json
@@ -0,0 +1,6 @@
+{
+ "plugins": [
+ ["transform-typescript", { "allowDeclareFields": true }],
+ "proposal-class-properties"
+ ]
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/output.js
new file mode 100644
index 000000000000..44b56f160013
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/transform-properties-declare/output.js
@@ -0,0 +1,8 @@
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
+class A {
+ constructor() {
+ _defineProperty(this, "y", void 0);
+ }
+
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/input.ts
new file mode 100644
index 000000000000..4bb8da7936c6
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/input.ts
@@ -0,0 +1,3 @@
+class A {
+ x!;
+}
\ No newline at end of file
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/options.json
new file mode 100644
index 000000000000..a6d406a50e49
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/options.json
@@ -0,0 +1,3 @@
+{
+ "plugins": [["transform-typescript", { "allowDeclareFields": true }]]
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/output.js
new file mode 100644
index 000000000000..a869c2849526
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/uninitialized-definite-with-declare-enabled/output.js
@@ -0,0 +1 @@
+class A {}
diff --git a/packages/babel-preset-typescript/src/index.js b/packages/babel-preset-typescript/src/index.js
index bb1687e623c4..f7dc5eefae00 100644
--- a/packages/babel-preset-typescript/src/index.js
+++ b/packages/babel-preset-typescript/src/index.js
@@ -4,7 +4,13 @@ import transformTypeScript from "@babel/plugin-transform-typescript";
export default declare(
(
api,
- { jsxPragma, allExtensions = false, isTSX = false, allowNamespaces },
+ {
+ jsxPragma,
+ allExtensions = false,
+ isTSX = false,
+ allowNamespaces,
+ allowDeclareFields,
+ },
) => {
api.assertVersion(7);
@@ -19,13 +25,18 @@ export default declare(
throw new Error("isTSX:true requires allExtensions:true");
}
+ const pluginOptions = isTSX => ({
+ jsxPragma,
+ isTSX,
+ allowNamespaces,
+ allowDeclareFields,
+ });
+
return {
overrides: allExtensions
? [
{
- plugins: [
- [transformTypeScript, { jsxPragma, isTSX, allowNamespaces }],
- ],
+ plugins: [[transformTypeScript, pluginOptions(isTSX)]],
},
]
: [
@@ -33,18 +44,13 @@ export default declare(
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.ts$/,
- plugins: [[transformTypeScript, { jsxPragma, allowNamespaces }]],
+ plugins: [[transformTypeScript, pluginOptions(false)]],
},
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.tsx$/,
- plugins: [
- [
- transformTypeScript,
- { jsxPragma, isTSX: true, allowNamespaces },
- ],
- ],
+ plugins: [[transformTypeScript, pluginOptions(true)]],
},
],
};
diff --git a/packages/babel-types/src/definitions/experimental.js b/packages/babel-types/src/definitions/experimental.js
index d344630dcc75..f4e110e1002f 100644
--- a/packages/babel-types/src/definitions/experimental.js
+++ b/packages/babel-types/src/definitions/experimental.js
@@ -67,6 +67,10 @@ defineType("ClassProperty", {
validate: assertValueType("boolean"),
optional: true,
},
+ declare: {
+ validate: assertValueType("boolean"),
+ optional: true,
+ },
},
});
From b114486bc111ff2a74afb3b17ff073f20436e129 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?=
Date: Tue, 5 Nov 2019 05:11:58 -0500
Subject: [PATCH 042/648] Traverse performance (#10480)
* perf: remove this.inList assignment
* perf: convert NodePath.parentKey into accessor function
* perf: compress shouldSkip/shouldStop/removed traverse flags
* perf: lazy initialize this.skipKeys
* perf: lazily initialize NodePath.data
* add code comments before bit operations
* remove unused typeAnnotation property
# Conflicts:
# packages/babel-traverse/src/path/index.js
* early return when visitor keys are empty
---
packages/babel-traverse/src/index.js | 4 ++
packages/babel-traverse/src/path/context.js | 22 ++++---
packages/babel-traverse/src/path/index.js | 67 ++++++++++++++++++---
packages/babel-traverse/src/path/removal.js | 5 +-
4 files changed, 77 insertions(+), 21 deletions(-)
diff --git a/packages/babel-traverse/src/index.js b/packages/babel-traverse/src/index.js
index fa0306e07cd0..da880632ad40 100644
--- a/packages/babel-traverse/src/index.js
+++ b/packages/babel-traverse/src/index.js
@@ -31,6 +31,10 @@ export default function traverse(
}
}
+ if (!t.VISITOR_KEYS[parent.type]) {
+ return;
+ }
+
visitors.explode(opts);
traverse.node(parent, opts, scope, state, parentPath);
diff --git a/packages/babel-traverse/src/path/context.js b/packages/babel-traverse/src/path/context.js
index 47c8f831f429..4a8c54197bb7 100644
--- a/packages/babel-traverse/src/path/context.js
+++ b/packages/babel-traverse/src/path/context.js
@@ -1,6 +1,7 @@
// This file contains methods responsible for maintaining a TraversalContext.
import traverse from "../index";
+import { SHOULD_SKIP, SHOULD_STOP } from "./index";
export function call(key): boolean {
const opts = this.opts;
@@ -43,7 +44,8 @@ export function _call(fns?: Array): boolean {
// node has been replaced, it will have been requeued
if (this.node !== node) return true;
- if (this.shouldStop || this.shouldSkip || this.removed) return true;
+ // this.shouldSkip || this.shouldStop || this.removed
+ if (this._traverseFlags > 0) return true;
}
return false;
@@ -97,12 +99,15 @@ export function skip() {
}
export function skipKey(key) {
+ if (this.skipKeys == null) {
+ this.skipKeys = {};
+ }
this.skipKeys[key] = true;
}
export function stop() {
- this.shouldStop = true;
- this.shouldSkip = true;
+ // this.shouldSkip = true; this.shouldStop = true;
+ this._traverseFlags |= SHOULD_SKIP | SHOULD_STOP;
}
export function setScope() {
@@ -122,10 +127,11 @@ export function setScope() {
}
export function setContext(context) {
- this.shouldSkip = false;
- this.shouldStop = false;
- this.removed = false;
- this.skipKeys = {};
+ if (this.skipKeys != null) {
+ this.skipKeys = {};
+ }
+ // this.shouldSkip = false; this.shouldStop = false; this.removed = false;
+ this._traverseFlags = 0;
if (context) {
this.context = context;
@@ -220,9 +226,7 @@ export function pushContext(context) {
}
export function setup(parentPath, container, listKey, key) {
- this.inList = !!listKey;
this.listKey = listKey;
- this.parentKey = listKey || key;
this.container = container;
this.parentPath = parentPath || this.parentPath;
diff --git a/packages/babel-traverse/src/path/index.js b/packages/babel-traverse/src/path/index.js
index a1be4f5d8d00..e73cbde9d1ee 100644
--- a/packages/babel-traverse/src/path/index.js
+++ b/packages/babel-traverse/src/path/index.js
@@ -23,15 +23,18 @@ import * as NodePath_comments from "./comments";
const debug = buildDebug("babel");
+export const REMOVED = 1 << 0;
+export const SHOULD_STOP = 1 << 1;
+export const SHOULD_SKIP = 1 << 2;
+
export default class NodePath {
constructor(hub: HubInterface, parent: Object) {
this.parent = parent;
this.hub = hub;
this.contexts = [];
- this.data = Object.create(null);
- this.shouldSkip = false;
- this.shouldStop = false;
- this.removed = false;
+ this.data = null;
+ // this.shouldSkip = false; this.shouldStop = false; this.removed = false;
+ this._traverseFlags = 0;
this.state = null;
this.opts = null;
this.skipKeys = null;
@@ -39,13 +42,10 @@ export default class NodePath {
this.context = null;
this.container = null;
this.listKey = null;
- this.inList = false;
- this.parentKey = null;
this.key = null;
this.node = null;
this.scope = null;
this.type = null;
- this.typeAnnotation = null;
}
parent: Object;
@@ -57,18 +57,16 @@ export default class NodePath {
removed: boolean;
state: any;
opts: ?Object;
+ _traverseFlags: number;
skipKeys: ?Object;
parentPath: ?NodePath;
context: TraversalContext;
container: ?Object | Array